Add user and ssh login settings

1、root@ubuntu:~# adduser kyle
    root@ubuntu:~# passwd kyle #Set password for kyle user
 
2. Add users to groups 
      root@ubuntu:~# usermod -G wheel kyle #Add the user to the group
      root@ubuntu:~# groups kyle #View user group information
 
3. Remove the user from the group
Edit /etc/group to find the GROUP1 line and delete kyle
or with the command
gpasswd -d kyle  wheel
 
4. View the relevant configuration of SUDO
     root@ubuntu:~# visudo /etc/sudoers #查看
 
5. Edit the configuration file /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys (this is the reason for changing the name later)
PasswordAuthentication no (closes the regular password login method, which transmits passwords in clear text)
 
6. Remember to restart the ssh service
  root@ubuntu:~# service sshd restart or /etc/rc.d/init.d/sshd restart

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326332887&siteId=291194637