阿里雲服務器禁用root並添加普通用戶設置權限

  1. 登錄阿里雲控制檯,重置root密碼
  2. 添加普通用戶
    1. adduser admin
    2. passwd xxxx
    3. whereis sudoers
    4. chmod -v u+w /etc/sudoers
    5. vi /etc/sudoers
    6. chmod -v u-w /etc/sudoers
  3. 禁用root
    1. vi /etc/ssh/sshd_config
    2. 修改PermitRootLogin 後面的yes 爲 no ,而且去掉前面的註釋符,退出並保存
    3. service sshd restart
  4. 修改文件夾權限

chown -R admin:admin admin/ssh

相關文章
相關標籤/搜索