The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
file access rights? vkishore.btw UNIX for Dummies Questions & Answers 1 04-25-2008 06:53 AM
FTP rights Burhan SUN Solaris 2 03-15-2007 04:22 AM
Unix access rights rudo UNIX for Dummies Questions & Answers 1 02-26-2007 03:40 PM
User rights sharmavr HP-UX 1 07-25-2006 12:16 AM
Groups Rights niasdad UNIX Desktop for Dummies Questions & Answers 3 07-16-2002 06:01 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-15-2004
Registered User
 

Join Date: Dec 2003
Posts: 24
chmod rights issue?

I want to grant the 'write' right to one user so they can delete log files in a given directory. These are http log files, so a new one is created each day. The file owner is 'nobody'. If I use the command 'chmod a=rwx *' will this work for the new files created each day.

I've tried the command 'chmod username+rwx *' and I get an error message that reads chmod: ERROR: invalid mode.
Forum Sponsor
  #2  
Old 01-15-2004
Registered User
 

Join Date: Jul 2002
Location: new york
Posts: 1,025
your syntax is incorrect. proper usage of the chmod command is:
chmod [+/-]drwx file or directory name


what it seems you want however, is to add that user to a group that has the rights to edit these files.
so, say you have a file access_log, this file has the premissions set to: -rw-r--r--
the owner of this file is nobody, and lets just say the group is httpd. so you could chmod +w access_log to add write privelages to users in the group assigned to that file. then you add your user to that group, httpd.

Last edited by norsk hedensk; 01-15-2004 at 12:08 PM.
  #3  
Old 01-15-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,609
Actually to delete a file, you need write permission to the directory. rm gives you an error if you try to delete a file that can't write. But "rm -f" forces the issue.

But if you can't write to the directory, there is no way. The kernel enforces that.
  #4  
Old 01-15-2004
Registered User
 

Join Date: Dec 2003
Posts: 24
ok, i need help creating the group and adding the user to the group. i'm using solaris 5.6, my aix man page says to use the command 'mkgroup'.
i've tried 'mkgroup' and 'mkgrp' solaris returns 'mkgrp or mkgroup not found'.

and, wouldn't you have to specify the group in the chmod command. my unix book has the example chmod g+x filename. i'm assuming you would replace filename with the directory name. if the group name is httpd would the command be chmod httpd+x directory name?
  #5  
Old 01-15-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,609
On solaris use groupadd.

The g is a constant. You don't replace it with the groupname.

chgrp httpd /some/directory
chmod g+w /some/directory
  #6  
Old 01-15-2004
Registered User
 

Join Date: Dec 2003
Posts: 24
how to i add the user to the group?
  #7  
Old 01-15-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,609
I would just "vi /etc/group". But you can use:
usermod -G groupname username
Google The UNIX and Linux Forums
Closed Thread

Tags
solaris

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0