configuring sftp to use passwords if there's no ssh key

Asked by Jason Frankovitz on 2011-01-06

I want to allow people to upload files to my 10.04 LTS server via sftp. So far I've been using ssh keys to allow passwordless logins. But one user doesn't understand how to set up his key on his local machine (Windows) so I want to use a password for him instead.

Is there a way to have the server look for an ssh key first, and if it doesn't find it, then prompt the user for a password?

Also, how do you restrict this to just a single user, while forcing everyone else to use a key?

Thanks for any advice!

Question information

English Edit question
Ubuntu openssh Edit question
No assignee Edit question
Last query:
Last reply:

Hi Jason Frankovitz,

AFAIK the behaviour you want is the default behaviour when you install openssh-server w/o changing anything in its configuration file: Users with keys are allowed to login without being prompted for a password AND users w/o keys *are prompted for a password*


That doesn't seem to be the default behavior on my system. If the user doesn't have an SSH key installed on the server, they are not prompted to enter a password. They are simply disconnected.

mycae (mycae) said : #3


Check your /etc/sshd/sshd_config file, and as needed uncomment (remove leading #)

#PasswordAuthentication no

and change it to

PasswordAuthentication yes

You will need to restart the ssh service afterwards.

Can you help with this problem?

Provide an answer of your own, or ask Jason Frankovitz for more information if necessary.

To post a message you must log in.