On a CentOS 7 server, I'd like to configure it such that:
- It accepts SSH connections, like PuTTY
- It denies SCP/SFTP connections, like SCP, WinSCP, and FileZilla
Is such a configuration possible?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Yes, you can.
To disable sftp, find the line that starts with
Subsystem sftp in the
/etc/ssh/sshd_config file (by default, it's near the very end of the file). Comment it out (put a
# at the beginning of the line) and restart sshd.
SCP has no such configuration, the client
scp program simply expects the remote
scp executable to be in the user's path. So, just delete the
scp binary to disable it. (And then you have to remember to delete it again every time you update your SSH package.)
But, as other people have said, this is not going to stop the users from uploading and downloading files. It just makes it ever-so-slightly more difficult. So, if you're doing this for security reasons, you really need to reconsider.