Common CentOS Server Maintenance Commands

ssh Configuration

  1. adduser new_user
    1. Create a new user named new_user and interactively set the password.
  2. usermod -aG wheel new_user
    1. Add new_user to the wheel group. Members of this group have default sudo command permissions.
  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 step 3 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 (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
What do you think?
0 Reactions
Pick a reaction
DevOps: Series Post List
  • 01. Common CentOS Server Maintenance Commands