0

Somehow some one from my team has changed our production server (RHEL 5.5) /etc and /home partitions ownership to oracle user. When i check /etc and /home with "ls -l /", it shows as follows

/etc and /home

Can i find who and when these changes are made?

Now is it possible to restore the ownership? or can i change the entire permissions to root user? Which one is possible and which one is safe.

Please help me in this issue.

puligilla
  • 45
  • 2
  • 8

1 Answers1

1

just try stat command

stat yourdirectory this will give you some details like this

stat /etc

Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-12-11 12:27:52.000000000 +1100
Modify: 2013-03-18 10:11:57.000000000 +1100
Change: 2013-03-18 10:11:57.000000000 +1100

you can change permissions on Linux/Unix using chown

chown root:root -R directory name (-R is to use recursive permissions , this changes will affect your whole directory structure ).

chown root:root direcotryname - will change only the directory , not sub directories.

this will change only the user and group. if you need to change the permissions you need to use chmod command. (like read,write,execute permissions)

this is a good reference about permissions on Linux

http://ubuntuforums.org/showthread.php?t=1252905

Hope this helps.

Tharanga Abeyseela

Tharanga Abeyseela
  • 3,255
  • 4
  • 33
  • 45
  • I knew how to change permissions and ownership to a directory. But all i want is whether there will be any impact on the OS or on any other services if we do so? – puligilla Dec 12 '13 at 09:01
  • change the /etc to root:root (normally most of the config files owned by root user) but /home directory is owned by the root user. but inside it, you may have different users,groups etc. user x has permission to access /home/x or another group like database admins..etc, it is hard to say. but most of the /etc directory own by root user. best way is to restore from backups.(latest full backup). may be you can restore both directories only. – Tharanga Abeyseela Dec 12 '13 at 21:35