0

How to ban password use on Ubuntu Hardy?

I will be using Ubuntu instances on EC2 where passwords are not used but private keys are used to login via ssh.

Thanks for help.

1 Answer 1

4

Change the PasswordAuthentication line in /etc/ssh/sshd_config to no:

Old:

#PasswordAuthentication yes

New:

PasswordAuthentication no

And the restart sshd:

/etc/init.d/sshd restart

You should be good to go.

5
  • Oh, make sure you have the keys working BEFORE you make this change :)
    – d34dh0r53
    Mar 29, 2010 at 3:54
  • Well I have modified the file. But cant restart sshd, I am getting error 'restart: command not found'. Another thing is there is no file called sshd in location/etc/init.d/. There is a file called ssh. So what do I do next?
    – April
    Mar 29, 2010 at 8:13
  • well, i have finally worked out how to retstart ssh but the system is still promting to enter a password if run command passwd. Doesnt seems like it has been fixed properly.
    – April
    Mar 29, 2010 at 8:29
  • Passwd is used to change the current password. It has no effect on if you may log in with the password or not. If you don't want a password promt there you have to run passwd as superuser. sudo passwd. You can setup sudo not to use password, using the sudoers file.
    – pehrs
    Mar 29, 2010 at 8:35
  • Yeah, it's /etc/init.d/ssh I'm used to RHEL systems, sorry :)
    – d34dh0r53
    Mar 29, 2010 at 18:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .