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

Asked by Jason Frankovitz

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!
-Jason

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu openssh Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Hilario J. Montoliu (hjmf) (hmontoliu) said :
#1

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*

HTH

Revision history for this message
Jason Frankovitz (jason-dotcomsformoms) said :
#2

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.

Revision history for this message
mycae (mycae) said :
#3

Jason:

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.