Changing group ownership
Hi there,
In Red Hat, I would like to know how to change the group ownership of a specific directory (not in GUI). I need to set chmod to 700 as well for one of the directories. Here are my problems: 1) change group ownership for .ssh directory from root to "x" 2) change permission for .ssh to –rwx------ (chmod 700) 3) change group ownership for authorized_keys file from root to "x" 4) change file permission for authorized_keys (chmod 640 authorized_keys) Can someone give any info on how this is to be done? I have root access. |
You could use the find command, for example:
1) change group ownership for .ssh directory from root to "x" A find command piped into sed or awk should do this. 2) change permission for .ssh to –rwx------ (chmod 700) Code:
find /home -type f -name ".ssh" -exec chmod 0700 {} \; Again sed/awk 4) change file permission for authorized_keys (chmod 640 authorized_keys) Code:
find /home -type f -name "authorized_keys" -exec chmod 0640 {} \; |
All times are GMT -5. The time now is 10:48 PM. |