Ubuntu server16.04 LTS版本:
win10用ssh协议(用命令行,暂时没有用xshell、putty等工具)连接Ubuntu server 16.04:

客户端:用工具(命令行、xshell、putty)连接服务器的一端: id_rsa
服务器端:保存公钥的一端:id_rsa.pub
服务器要有openssh:
没有就安装:
apt-get install openssh-server //安装ssh服务

首先在win10使用(得安装有git)
ssh-keygen -t rsa
一路回车 命令就可以生成公钥和私钥。保存在
C:\Users\Administrator.ssh\

所选的用户密钥未在远程主机上注册(腾讯云服务器,是公钥没有配置,即authorized_keys是空的)
然后用FTP把id_rsa.pub 上传到服务端。
到/root/.ssh目录下执行:
root@ubuntu:~/.ssh# cat id_rsa.pub > authorized_keys
就是把公钥的字符串复制到authorized_keys里面

然后编辑:
/etc/ssh/sshd_config文件:
root@ubuntu:/etc/ssh# vim sshd_config

AuthorizedKeysFile /root/.ssh/authorized_keys #这句话一定要加,因为是指定公钥的文件路径。建议使用绝对路径。

PermitRootLogin yes #允许root账号直接登录

编辑完成:
重启ssh服务:
service ssh restart