Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.