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.

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.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
Oh, make sure you have the keys working BEFORE you make this change :) –  d34dh0r53 Mar 29 '10 at 3:54
    
Thanks for this. I will give it a go. –  April Mar 29 '10 at 4:07
    
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 '10 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 '10 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 '10 at 8:35

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.