LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Getting 'permission denied' message. (https://www.linuxquestions.org/questions/linux-newbie-8/getting-permission-denied-message-4175507395/)

srijivdimri 06-08-2014 05:47 AM

Getting 'permission denied' message.
 
Hi EXPERTS,

I hope I dint messed up things big time, but I am getting the 'permission denied' message when trying to view or modify a directory/file of a different user from root account. This issue started to happen when I accidentally ran ' chmod -R 755 / ' .

[root@shfcolo-opfch-rtd1 data]# su amanda
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
DISPLAY set to 106.51.43.133:0
bash: /dev/null: Permission denied
[amanda@shfcolo-opfch-rtd1 data]$ crontab -e
/tmp/crontab.jGP5fB: Permission denied

please help me to get out of this trouble.

Appreciate all your help in advance.

jdkaye 06-08-2014 06:28 AM

Are you trying to do this as root or as a normal user?
jdk

unSpawn 06-08-2014 06:28 AM

Quote:

Originally Posted by srijivdimri (Post 5184473)
I accidentally ran ' chmod -R 755 / ' .

Undo your atrocious error and next time think before you act.

srijivdimri 06-08-2014 06:32 AM

Thanks jdk,

I am trying to do this as a 'root'.

Thanks unSpawn for looking into this. It was a complete accident. Please let me know how this can be corrected or undo.

unSpawn 06-08-2014 06:47 AM

In the case of a RHEL, CentOS, SL or other RPM-using distribution see 'man rpm' (--setperms|--setugids), though that understandably only works for files the RPMDB knows about. For other files you best get the permissions from like a verbose backup listing.

jpollard 06-09-2014 05:14 AM

You may be out of luck and have to reinstall. Try unspawns rpm suggestion first - this should restore the system to a usable state, though it will not fix users files (/home got affected too). For that, you would have to go to backups... and even then, files created after the backup will have the wrong access mode.

If the rpm commands don't work you may be out of luck and have to reinstall.


All times are GMT -5. The time now is 03:18 AM.