elabx
9/12/2016 - 10:22 PM

steps to create new SFTP user/account

steps to create new SFTP user/account

#### This is mainly for VMs managed by ServerPilot control panel using Ubuntu 14.04
#### But in theory will work for VMs in general ie: DigitalOcean or AWS instance

#### 1 Add new user
useradd <new_user> 

#### 2 Follow on screen prompts - this will allow SFTP with the password set from the prompts
#### If there are no prompts just move on to Step 3 You will reset the password in the last step

#### 3 Update user's home directory to ServerPilots Apps OR vim /etc/passwd to change the new users path
usermod -d /srv/users/serverpilot/apps <new_user>  

#### 4 Add user to the ServerPilot Group for permission
usermod -a -G serverpilot <new_user>

#### 5 Check permission
ls -ld /srv/users/serverpilot/apps/ # should look like drwxr-xr-x 2 root serverpilot 4096 Jan 27 09:08 /srv/users/serverpilot/apps/

#### 6 Add read write execute permission to ServerPilot Group
chown -vR :serverpilot /srv/users/serverpilot/apps/  # changed ownership of /srv/users/serverpilot/apps/ from root:root to :serverpilot

#### 7 Grant write permission to the group owner
chmod -vR g+w /srv/users/serverpilot/apps/ # changed from 0755 (rwxr-xr-x) to 0775 (rwxrwxr-x)

#### 8 change password of the new user (only if prompt didn't work)
sudo passwd <new_user>