SSH登陆后显示Could not chdir to home directory

2025-03-07 03:56:53
推荐回答(3个)
回答1:

我是估计的:
你在linux上创建了一个用户,然后可以用这个用户登陆你的linux主机上的ftp服务器,但是你把这个用户对应的linux主机上的home下的家目录给删掉了,虽然ftp依然可以登陆,但是已经不能指向此用户的家目录了,因为已经被你删了。
不好确定肯定是因为这个原因,你可以试着检查一下。

回答2:

We changed the home folder to /data/home/USER.

When I ssh to our centos server. It shows error “Could not chdir to home directory /home/USER: Permission denied”, however loggin ok. I must manually run cd ~ to go to the home directory.

Googled around, and found it is caused by selinux. The solution:

To disabling selinux or change it from enforcing to permissive.
vi /etc/sysconfig/selinux
change SELINUX from enforcing to permissive: SELINUX=permissive, then reboot.

For server could not be rebooted:
#setenforce permissive

You can check if set correctly
#getenforce

回答3:

随着对iPhone应用的深入,您会越来越觉得iPhone是一台电脑,你可以利用OpenSSH显示现在时间和日期的命令。。 df 显示可用磁盘空间: 打开后可以详细你所用