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 03:22 AM
Unix access rights rudo UNIX for Dummies Questions & Answers 1 02-26-2007 02: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 (permalink)  
Old 01-15-2004
Registered User
 

Join Date: Dec 2003
Posts: 24
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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 (permalink)  
Old 01-15-2004
Registered User
 

Join Date: Jul 2002
Location: new york
Posts: 1,025
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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 11:08 AM.
  #3 (permalink)  
Old 01-15-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,253
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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 (permalink)  
Old 01-15-2004
Registered User
 

Join Date: Dec 2003
Posts: 24
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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 (permalink)  
Old 01-15-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,253
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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 (permalink)  
Old 01-15-2004
Registered User
 

Join Date: Dec 2003
Posts: 24
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
how to i add the user to the group?
  #7 (permalink)  
Old 01-15-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,253
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
I would just "vi /etc/group". But you can use:
usermod -G groupname username
  #8 (permalink)  
Old 01-15-2004
Registered User
 

Join Date: Dec 2003
Posts: 24
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
thanks to both of you for helping me with this problem. it's much appreciated.
Google UNIX.COM
Closed Thread

Tags
solaris

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash exec bash for loop close_wait command copy/move folder in unix couldn't set locale correctly curses.h cut command in unix dead.letter find grep find null character in a unix file grep multiple lines grep or grep recursive inaddr_any inappropriate ioctl for device ksh if logrotate.conf lynx javascript mailx attachment mget mtime ping port remove first character from string in k shell replace space by comma , perl script scp recursive segmentation fault(coredump) sftp script snoop unix stale nfs file handle syn_sent tar exclude test: argument expected unix unix .profile unix forum unix forums unix internals unix interview questions unix mtime unix simulator unix.com vi substitute vi+substitute+end+of+line+character while loop within while loop shell script


All times are GMT -7. The time now is 07:20 AM.


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

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101