Ubuntu Server用户必须本地登录后才能远程ssh登陆

几经周转,设置/usr/sbin/sshd -d再debug模式下跟踪发现/home/xxx/.ssh/authorized_key文件不存在。怪了,明明有的啊,难道是权限不正确?目录.ssh是700没错,authorized_key是600也没错啊.无意想起来装系统时询问我是否加密home的时候选择了加密,是不是加密的原因?选择root用户登陆后发现xxx用户没登陆的时候home目录内容全部为空,怪不得,原来如此,只有我登陆了后才能访问.ssh目录。原因找到后就好办了,果断卸载加密服务。

以下是ubuntu的帮助中心找到的方法:

To remove this setup:

Ensure that you have moved all relevant data out of your ~/Private directory

Unmount your encrypted private directory

ecryptfs-umount-privateMake ~/Private writable again

chmod 700 ~/PrivateRemove ~/Private, ~/.Private, ~/.ecryptfs (Note: THIS IS VERY PERMANENT AND WILL DELETE ALL YOUR FILES, NOT JUST THE ENCRYPTED COPIES!)

rm -rf ~/Private ~/.Private ~/.ecryptfsUninstall the utilities

sudo apt-get remove ecryptfs-utils libecryptfs0

猜你喜欢

转载自www.linuxidc.com/Linux/2016-09/135490.htm