Friday, June 14, 2013

Could not chdir to home directory /home/user: Permission denied -bash: /home/user/.bash_profile: Permission denied

Error : Could not chdir to home directory /home/user: Permission denied -bash: /home/user/.bash_profile: Permission denied

The error opens the bash prompt instead of user prompt when user tries to login using ssh.
Set the home directory permission to 775
$ chmod 775 /home/

It sets the permission of directory /home 775. Do not give recursive permission, it means the permission of directories inside /home (sub-dirs of /home) should not be 775. They should be 700.

/home should be 775 & directories inside /home should be 700.

If you think it will increase the number of hazardous attempts, then try second solution. Although it is about security too. You should disable the SELinux.

SSH : agent admitted failure to sign using the key

Error : Agent admitted failure to sign using the key :

Solution :

Run following command on the client
# ssh-add



Permissions for .ssh directory and authorized_keys file

Permissions for .ssh directory and authorized_keys file

The permission for directory .ssh should be 700. It means drwxr_xr_x
# chmod 700 ~/.ssh

The permission for file authorized_keys should be 600. 
It means -rw_____
# chmod 600 ~/.ssh/authorized_keys