I have an Ubuntu Server running on an EC2 instance. To login to that server I use a certificate file without any password.
I've installed and configured vsftpd and created a user (let's call him "testuser") for which I've set a /bin/false ssh terminal so it will only be able to connect via sftp and upload/access files on his home directory.
However - when I try to connect to the server from my computer, running
sftp testuser@my-ec2-server
I get
Permission denied (publickey).
Connection closed
messages so I can't log in.
How can I remove the certificate requirement for this user only (meaning, the "ubuntu" user will still have to use the certificate file to login via ssh), so normal sftp clients will be able to connect using a username and a password ?
Thank you.
PS Using Ubuntu Server 10.10 official AMI from canonical, 64bit on a micro instance.
In order to accomplish what you wish, you need to do two different things
I shall say first of all that it's a bad idea to do this, I would rather generate a certificate for your user than activate passwords, nonetheless if you want to do so just edit
/etc/ssh/sshd_config
and change or uncomment it so it showsPasswordAuthentication yes
. Once that is done restart sshdservice ssh restart
In order to acomplish that you need to install rsh (resticted shell) and change the user shell to it
chsh username
Here is a step by step guide to allow:
First, edit your /etc/ssh/sshd_config file:
Scroll down and modify:
and add this at the bottom:
Press Ctrl-X to exit and save.
Now add the user:
Now add the groups and disable ssh:
Now set permissions:
All this is while logged in as a root user (ec2-user on Amazon Linux AMIs)