Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have blocked FTP 21 port on server. NOw every connection will be via SFTP via ssh.

Initially i had /etc/hosts.deny -- sshd:all

But i had to remove that otherwise sftp was not working.

How can i secure my shell login so that if someone login via root or userbac(root previleges)

Then i need private key but not for other users

Or any other to secure my system


share|improve this question

1 Answer 1

You can do a couple of things:

1) Require an RSA key for login to ssh.

2) Block port 22 on iptables with a single exception for the IP that you want to allow.

share|improve this answer
if i block port 22 or use RSA key will my clients be able to use SFTP –  John Jun 10 '10 at 3:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.