Adding a new user to a server Print

  • 0

To add a new user to your server and create an isolated site, follow the following tutorial.

  1. Log into the server and escalate your user to sudo permissions. 
  2. Add a new user to ubuntu using the following command:
    useradd -m -d /home/username -s /bin/bash username​
    *replace "username" with the name of the new user you are adding.
  3. masq into the new user using the following command:
    su username​

    *replace "username" with the name of the new user you just created.

  4. move to the new user's home directory
    cd ~​
  5. Create a new SSH keypair so that user can connect to the server via SSH
    ssh-keygen -t rsa​
  6. Press "return" to set the location of the new rsa key to the default location (/home/username/.ssh/id_rsa):
  7. Press "return" to skip adding a passphrase
  8. Press "return" to confirm skipping of a new passphrase
  9. Output the public key to use in your SFTP tools.
    cat ~/.ssh/id_rsa.pub​
  10. Copy the output and save it in your SFTP tool as a key.
  11. Test the SSH connection.

Was this answer helpful?

« Back