Creating a SSH/SFTP User on Your VPS
These instructions create another user to login via the command line (SSH or secure shell) or SFTP. These instructions will grant "super user" privileges to the user, so give the login details only to someone you trust to administer the entire server, including access to all files and databases.
Note: replace all occurrences of username with the username you want to give to the person.
- login to your VPS via SSH
sudo su- this gets you as the root user
/usr/sbin/useradd usernamepasswd username- this is to set the user's password
/usr/sbin/visudo- this edits the super users file in vi. You need to know how to use vi to do that, but we have the keyboard commands you need listed below.
- add the username to the line that starts with "User_Alias":
- to do this, move down to the line you want to edit
- press 'i'
- then add the name at the end of the list
- press Esc
- to save, type ':w' (without quotes) then Enter
- to quit, type ':q!' then Enter.
/usr/sbin/usermod -g admin username- this adds the user to the 'admin' group
ln -s /var/www/ /home/username/- this creates a symbolic link or shortcut to the web-accessible directory in their home directory. You can even specify a directory deeper in the web-accessible folder, such as
/var/www/html/sites/yourdomain/themes/for a theme designer to access quickly. chown .admin /var/www/* -R- this adds ownership of all files below /var/www/ to the 'admin' group you should only have to do this once. The dot in the command is important.