bash: /home/user/.bashrc: Permission denied when try to change user from root to user

Posted on

Problem :

I’m on centos, when I login as root and use su x to change user to x, it shows this:

bash: /home/x/.bashrc: Permission denied

I try to source ~/.bashrc but nothing changes and I also tried following the instructions at this link.

I also can’t ssh to user x.

How can I fix this?

Solution :

actually problem was about /home/* files, they owner of all files had changed due to execution of a wrong shell, so it solved by changing permissions of /home/* with a simple bash script.

Leave a Reply

Your email address will not be published.