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