LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-27-2015, 07:37 PM   #1
kilosi
LQ Newbie
 
Registered: Mar 2015
Posts: 4

Rep: Reputation: Disabled
chgrp not changing a file?


Hello,

OS: CentOS 6.3

Background:
I'm trying to set up a situation where my FTP account is in a group where my phpbb forums were created. This will allow me to upload changes as I customize my forums (ie: .css files). However, right now, my problem is that I'm running into invalid permissions and the only way to move the files is to upload the file to a directory my FTP account has access too and then sudo cp the file over. Upon closer inspection of my files, it appears the groups the files have been made under are not the correct group.

Problem:
I am trying to use chgrp on a specific file to change the group owner to the group my FTP account is a member of but it does not seem to be working. Here is a snippet of what I'm doing:

Code:
zzz@aaaa:/var/www/html/yyy/forums/styles/GlossyBlack/theme]$ sudo chgrp apache colours.css -v
group of `colours.css' retained as apache
zzz@aaaa:/var/www/html/yyy/forums/styles/GlossyBlack/theme]$ ls
total 164
drwxr-xr-x 3 5645316 apache  4096 Mar 27 15:11 .
drwxr-xr-x 6 5645316 apache  4096 Nov 18  2012 ..
-rw-r--r-- 1 root    apache 23480 Mar 27 19:05 colours.css
I'm not sure why it still says root so I suspect I am doing something incorrect. When looking around, at first it seemed chgrp could change group owner on files but as I dug more, it seemed it can also change groups themselves. So I'm a little confused and require some clarity of experts.

I hope changing the group owner of this file will give access to my FTP account so I can apply this change to all needed locations.

Thanks.
 
Old 03-28-2015, 04:43 AM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,307
Blog Entries: 2

Rep: Reputation: Disabled
Try...
Code:
sudo chown <user or blank for no modification>:<group or blank for no modification>
see example:
Code:
bash-4.3$ ls -alh target 
-rw-r--r-- 1 willie users 0 Mar  3 07:11 target
bash-4.3$ sudo chown root:wheel target
Password: 
bash-4.3$ ls -alh target
-rw-r--r-- 1 root wheel 0 Mar  3 07:11 target
bash-4.3$ sudo chown :users target
bash-4.3$ ls -alh target
-rw-r--r-- 1 root users 0 Mar  3 07:11 target
bash-4.3$ sudo chown willie: target
bash-4.3$ ls -alh target
-rw-r--r-- 1 willie users 0 Mar  3 07:11 target
Hope that helps

Last edited by dijetlo; 03-28-2015 at 04:46 AM.
 
Old 03-28-2015, 11:08 AM   #3
kilosi
LQ Newbie
 
Registered: Mar 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Ah!

That was it - I now have set all of my files to the group. When I was originally executing chown, I was not setting the group - only the user. This explains what was going on.

Thanks for the help.
 
Old 03-28-2015, 11:18 AM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
The first column is the owner, the second column is the group. That file was already in the group "apache":
Code:
$ ls
total 164
drwxr-xr-x 3 5645316 apache  4096 Mar 27 15:11 .
drwxr-xr-x 6 5645316 apache  4096 Nov 18  2012 ..
-rw-r--r-- 1 root    apache 23480 Mar 27 19:05 colours.css
Which is why nothing was happening, and which is why it gave you the warning:
Code:
group of `colours.css' retained as apache
The owner of that file is root. To change the owner you use chown (CHange OWNer) rather than chgrp (CHange GRouP).
 
Old 03-28-2015, 11:51 AM   #5
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,307
Blog Entries: 2

Rep: Reputation: Disabled
No problem, Kilosi. We a love a good cli question 'round here.
Gives us old guys a chance to show off...

Last edited by dijetlo; 03-28-2015 at 12:17 PM.
 
Old 03-28-2015, 03:51 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,601

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
and if that doesn't work, check the security label on the file. Copying the file should cause it to inherit the correct label, doing an "mv" on it will not.
 
Old 03-28-2015, 07:27 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
also BE AWARE!!!
CentOS 6.3 is UNSUPPORTED!
CentOS 6.4 is UNSUPPORTED!
CentOS 6.5 is UNSUPPORTED!

Cent ONLY supports the CURRENT minor version

upgrade to 6.6 ASAP!!!
you are missing 2 years of SECURITY updates and fixes
6.3 is VULNERABLE to EVERYTHING that has been fixed in the last TWO YEARS!!!!
 
1 members found this post helpful.
Old 03-29-2015, 02:41 PM   #8
kilosi
LQ Newbie
 
Registered: Mar 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
also BE AWARE!!!
CentOS 6.3 is UNSUPPORTED!
CentOS 6.4 is UNSUPPORTED!
CentOS 6.5 is UNSUPPORTED!

Cent ONLY supports the CURRENT minor version

upgrade to 6.6 ASAP!!!
you are missing 2 years of SECURITY updates and fixes
6.3 is VULNERABLE to EVERYTHING that has been fixed in the last TWO YEARS!!!!
Can you provide me some links on how I can upgrade? I'm currently running a VPS so have to do it myself.

Thanks.
 
Old 03-29-2015, 06:32 PM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
yum update
 
Old 03-29-2015, 06:33 PM   #10
kilosi
LQ Newbie
 
Registered: Mar 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
yum update
Is the update of the OS going to force a reboot of the machine? I will need to schedule downtime if it will, since its a production server.

Thanks!!
 
Old 03-29-2015, 07:21 PM   #11
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,307
Blog Entries: 2

Rep: Reputation: Disabled
Anytime you modify the kernel,you're going to have to reboot. You can do the update, check the logs to make sure you've got a good load and then reboot on your own schedule (we do that in the course of a single night, usually). Changes to the kernel do not take effect until you reboot.
 
  


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
chgrp thiyagusham Linux - Newbie 3 11-14-2012 10:37 AM
chgrp: operation not permitted even though I own the file! the theorist Linux - Newbie 16 05-29-2010 12:02 AM
permissions using cmod/chgrp not changing heyme Linux - Newbie 5 11-18-2007 06:46 PM
chgrp after creating a file yull Linux - Security 2 02-06-2006 04:28 PM
file perm, chgrp, chmod, and umask Martini Linux - Newbie 2 08-06-2002 09:04 PM


All times are GMT -5. The time now is 08:08 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration