If you are using the free plan of ServerPilot but need additional SFTP and SSH user accounts, then here are the steps to create a new account. The created users will have write permissions to certain directories only (specified by you) so this is a good way to go if you want to host multiple users’ websites in a single server managed through ServerPilot’s free plan. Here are the steps:
Sign into your server as root via SSH and execute this command:
useradd -d /srv/users/serverpilot/apps/appname/ -G serverpilot -M username
The above command will create a new user, will set the specified home directory for the user and will add the user to serverpilot group.
Next, adjust the permissions on the specified directory for your newly created user like this:
chown -vR :serverpilot /srv/users/serverpilot/apps/appname/ | chmod -vR g+w /srv/users/serverpilot/apps/appname/
Now lastly, set a password for the user.
Set and confirm the password and that’s it. Now you will have a new user with restricted write access to the specified path only. Don’t forget to use your real app’s name and the username in place of the highlighted values. Do you have any questions or suggestions? Leave a comment below.