注意.ssh 文件夹的属性
特别是新建用户时
最好先用ssh-keygen生成一下这个文件夹而不是自己新建一个
文件夹的权限为 700
drwx------ 4 devuser devuser 4096 7月 15 14:02 .
drwxr-xr-x. 5 root root 4096 7月 15 13:56 ..
-rw------- 1 devuser devuser 437 7月 15 14:04 .bash_history
-rw-r--r-- 1 devuser devuser 18 10月 31 2018 .bash_logout
-rw-r--r-- 1 devuser devuser 193 10月 31 2018 .bash_profile
-rw-r--r-- 1 devuser devuser 231 10月 31 2018 .bashrc
drwx------ 2 devuser devuser 4096 7月 15 14:02 .ssh
drwxr-xr-x 2 devuser devuser 4096 7月 15 14:02 .vim
-rw------- 1 devuser devuser 740 7月 15 14:02 .viminfo
否则是不会生效的