1: Create a regular user account and home directory for your user
# /usr/sbin/adduser jones
2: Add the user to the AllowedUsers in your /etc/ssh/sshd_config file
AllowUsers jones smith
3: Restart sshd
# /etc/init.d/sshd restart
4: Check that you can login remotely as that user - ssh and sftp should both work
% ssh jones@yourhost
% sftp jones@yourhost
5: Figure out where you sftp-server executable lives - look in /etc/ssh/sshd_config for this line:
Subsystem sftp /usr/lib/openssh/sftp-server
6: Edit /etc/passwd and replace the default shell for your user with this path
jones:x:1004:1004:Rob Jones,,,:/home/jones:/bin/bashbecomes:
jones:x:1004:1004:Rob Jones,,,:/home/jones:/usr/lib/openssh/sftp-server
7: Connecting with sftp should now work normally but if you try ssh you will get prompted for the password at which point nothing will happen.
Very interesting material. Well when there is so much a new. Many thanks, simply class
ReplyDeletecollege board .