新建普通用戶
## 新建普通用戶
$ adduser ubuntu
$ apt-get install sudo
## 將用戶加入sudo組
$ usermod -a -G sudo ubuntu
為普通用戶添加公鑰
$ su ubuntu
$ mkdir -p ~/.ssh
$ cd ~/.ssh
## 添加公鑰
$ touch authorized_keys
$ cat '你的公鑰字串' >> authorized_keys
$ chmod 600 authorized_keys
$ chmod 700 ~/.ssh
設定 SSH,打開密鑰登錄
$ vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
## 禁用root賬號登錄
PermitRootLogin no
## 禁用密碼登錄
PasswordAuthentication no
$ service sshd restart
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/88174.html
標籤:其他
上一篇:Ubuntu 搭建phpcms
下一篇:理解一致性Hash演算法
