LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-28-2007, 04:03 PM   #1
rayn0r
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Rep: Reputation: 0
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.

Last edited by rayn0r; 11-28-2007 at 04:05 PM.
 
Old 11-28-2007, 04:35 PM   #2
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
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 {} \;
3) change group ownership for authorized_keys file from root to "x"

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 {} \;
I'll have a think about 1 & 3 on how to achieve this.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ownership, group and premission changing problem gubak Linux - Newbie 9 05-08-2007 01:29 AM
Group Permissions and Ownership of files and folders bugeyemonster Linux - General 1 04-19-2006 01:52 AM
changing ownership and group of multiple files.. utanja Debian 3 02-21-2005 06:10 PM
unable to modify ownership or group as root bubblehead Linux - Newbie 0 11-24-2003 09:15 PM
changing users and group ownership dkc_ace Linux - General 4 02-03-2003 07:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration