How to add and remove external user on the server?
In some cases there might be a need to add a new SSH user, or remove a user, from the server. Our environment is built to have one SSH user per a web site, but the user may have several SSH keys. With the SSH key, access to the server is possible without knowing the original SSH password.
Adding SSH key to server
SSH key is the most recommended method to access the server in eg. these cases:
- Website owner or developer wants to access the server, eg. to use terminal or transfer files (scp) without using password
- Developer (eg. from outside own organization) needs to access the server, but the site owner doesn't want to provide the credentials (this is the most recommended way).
If you don't have the SSH key yet, it can be generated by following our instructions.
Copy the public key to the server (using your own server and port details):
$ ssh-copy-id -p 12345 email@example.com
The public key can also be added by copying it to /home/user/.ssh/authorized_keys file. The file can be edited eg. with editor nano (add the public key to a separate row):
$ nano /home/username/.ssh/authorized_keys
Again, you can also remove the key and prevent user's access to the server by just deleting the key row from the file.
Changing SSH password
There can currently only be one SSH password per site. That means production and shadow instances of your site will all have the same password. If the SSH password needs to be changed, it can be reset using the command below. The new password will be printed and taken in use immediately. Be sure not to lose it as it won't match the one sent in the credentials email. In case you do lose it, contact the customer service to reset the password.