阿里服务器用户的添加

阿里服务器一开始用户名是一串乱码,对其更改如下,就是新添加一个用户:

1.nano /etc/hostname :## 改为相应项目名称

2.nano /etc/hosts  :##127.0.0.1 【项目名称】

3.添加相应用户 :adduser【项目名称】

4.nano /etc/sudoers   ## 允许SUDO权限  【项目名称】 ALL=(ALL:ALL) ALL

5./etc/rc.d/init.d/ssh restart    ##重启服务器

nano /etc/ssh/sshd_config    PermitRootLogin no  ## 测试可以登录并有SUDO权限之后,关闭root登录

原文地址:https://www.cnblogs.com/sqsnbrdcwlcfzj/p/6233572.html