sudo adduser xxx
# 指定主目录
# 例如
# sudo adduser xxx --home /new_home/xxx
# 输入密码
sudo chmod 755 /home/xxx
su xxx
# 输入密码
ssh-keygen
# 一路回车
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
chmod 777 ~/.ssh
chmod 777 ~/.ssh/id_rsa
# 然后把 id_rsa 下载下来
chmod 600 ~/.ssh/id_rsa
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

然后就可以根据 id_rsa 登录了.