How Do I Restrict Scp in Linux?
Contents as Others Have Noted, You Can’t Block Scp (Well, You Could: Rm /Usr/Bin/Scp, but That Doesn’t Really Get You Anywhere). the Best You Can Do Is to...
As others have noted, you can’t block scp (well, you could: rm /usr/bin/scp , but that doesn’t really get you anywhere). The best you can do is to change the users’ shell to a restricted shell (rbash) and only then to run certain commands. Remember, if they can read files, they can copy/paste them off the screen.
How Stop SCP command in Linux?
Background & Disown the Process
- Open ssh terminal to remote server.
- Begin scp transfer as usual.
- Background the scp process ( Ctrl + Z , then the command bg .)
- Disown the backgrounded process ( disown ).
- Terminate the session ( exit ) and the process will continue to run on the remote machine.
Must Read
How do I restrict access in Linux?
Limit User’s Access To The Linux System Using Restricted Shell. First, create a symlink called rbash from Bash as shown below. The following commands should be run as root user. Next, create an user called “ostechnix” with rbash as his/her default login shell.