/etc/profile: Permission denied after restarting Amazon EC2

0

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.

deepakgates

Posted 2015-05-16T15:27:22.700

Reputation: 15

Answers

1

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.

td512

Posted 2015-05-16T15:27:22.700

Reputation: 4 778

-2

they should be 700 and 600 respectively

linuxdev2013

Posted 2015-05-16T15:27:22.700

Reputation: 1 051

why 700 and 600? – td512 – 2015-05-16T15:51:34.047

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 – 2015-05-16T16:00:19.230

true, but those two files mentioned above have 0665 as the permission – td512 – 2015-05-16T16:05:24.307

why would you need ANY OTHER user but the user in question to have r/w or write /execute on YOUR file – linuxdev2013 – 2015-05-16T16:07:09.393

1it's not ~/.bashrc and ~/.profile these are 0665 on /etc/profile and /etc/bashrc – td512 – 2015-05-16T16:08:25.890

which are read prior to ~/bashrc & ~/profile and I highly doubt a global access strategy to those files is desired either – linuxdev2013 – 2015-05-16T16:11:33.503

did not fix the error – deepakgates – 2015-05-16T16:14:54.780

I'm just putting the exact output or ls -l /etc/profile and /etc/bashrc – td512 – 2015-05-16T16:15:03.013