SFTP allow user to login via SFTP

If we are just allowing both on AllowUsers in file /etc/ssh/sshd_config, new users won’t be allowed to access the server.

So!, lets edit it a add the new user. Find AllowUser line and add it there.

sudo nano /etc/ssh/sshd_config

This should look something like

#PermitRootLogin without-password
PermitRootLogin no
StrictModes yes
AllowUsers bofh newuser

Save and Exit!
Restart SSH

service ssh restart

Now the user!

addgroup --system filetransfer

usermod -G filetransfer username
chown root:root /home/username
chmod 755 /home/username

cd /home/username
chown username:filetransfer *

 

Hooray!

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*