1. adduser
root@ubuntu:~# adduser lwk perl: warning: Setting locale Failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset),LC_ALL = (unset),LC_PAPER = "zh_CN.UTF-8",LC_ADDRESS = "zh_CN.UTF-8",LC_MONETARY = "zh_CN.UTF-8",LC_NUMERIC = "zh_CN.UTF-8",LC_TELEPHONE = "zh_CN.UTF-8",LC_IDENTIFICATION = "zh_CN.UTF-8",LC_MEASUREMENT = "zh_CN.UTF-8",LC_NAME = "zh_CN.UTF-8",LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to a fallback locale ("en_US.UTF-8"). Adding user `lwk' ... Adding new group `lwk' (1001) ... Adding new user `lwk' (1001) with group `lwk' ... Creating home directory `/home/lwk' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for lwk Enter the new value,or press ENTER for the default Full Name []: lwk Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] root@ubuntu:~#
2.sudo权限
usermod -a -G sudo lwk
3.install openssh-server
root@ubuntu:~# apt install openssh-server
4.添加本地公钥到远程服务器上去
lwk@qwfys ~ $ ssh-copy-id -i ~/.ssh/id_rsa.pub lwk@192.168.1.25
如果些前已经用当前密钥登录过远程服务器,需要用下面命令从本地删除老的远程服务器列表
lwk@qwfys ~ $ ssh-keygen -f "/home/lwk/.ssh/known_hosts" -R 192.168.1.25
5. ssh登录
lwk@qwfys ~ $ ssh lwk@192.168.1.25 Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage 75 packages can be updated. 32 updates are security updates. Last login: Fri Nov 10 14:53:04 2017 from 192.168.1.4 lwk@ubuntu:~$原文链接:https://www.f2er.com/ubuntu/350624.html