I restarted my Amazon EC2 instance and all of sudden when I log in from SSH via putty I get the error:

-bash: /etc/profile: Permission denied
-bash: /etc/bashrc: Permission denied

Previously I was able to log in via SSH but after restart I can not. I do have access to Super User so I can change permissions. I tried changing permissions on /etc/profile like 770 and 771 but couldn’t fix the issue.

Permissions on both files is 750.


Looking at my EC2 instance, the permissions on /etc/bashrc and /etc/profile are 0665. You should change your install to use those permissions and restart the server to have the changes take affect.


they should be 700 and 600 respectively

  • why 700 and 600? – td512 May 16 '15 at 15:51
  • Its not the rc or profile files themselves that are the issue its that they don't have access to the ssh key which itself should be 600 in a parent folder toting a 700 – linuxdev2013 May 16 '15 at 16:00
  • true, but those two files mentioned above have 0665 as the permission – td512 May 16 '15 at 16:05
  • why would you need ANY OTHER user but the user in question to have r/w or write /execute on YOUR file – linuxdev2013 May 16 '15 at 16:07
  • 1
    it's not ~/.bashrc and ~/.profile these are 0665 on /etc/profile and /etc/bashrc – td512 May 16 '15 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.