SSH Configuration

  1. adduser new_user
    1. Create a new user named new_user in the system and interactively set the password.
  2. usermod -aG wheel new_user
    1. Add new_user to the wheel group. Members of this group default have the permission to use sudo commands.
  3. ssh-keygen -t rsa -b 4096 -C "bowmanjin new_user ssh account"
    1. Generate a pair of RSA keys for identity verification, with comments for identification.
  4. `ssh-copy-id -i C:\Users\Jin.ssh\id_rsa_new_user.pub new_user@ip
    1. Install the public key generated in the previous step on the remote server to log in using the private key without entering a password.
  5. `ssh -i C:\Users\Jin.ssh\id_rsa_new_user -p 2222 new_user@ip
    1. Connect to the remote server using the specified private key file and port number (2222).
  6. new_user ALL=(ALL) NOPASSWD: /usr/bin/rsync, ... (in /etc/sudoers file)
    1. Configure finely in the /etc/sudoers file to allow new_user to run specific commands like rsync without a password.
# which rsync
/usr/bin/rsync