Visit Our UNIX and Linux User Community

chmod rights issue?

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers chmod rights issue?
# 1  
Old 01-15-2004
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.
# 2  
Old 01-15-2004
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 03:08 PM..
# 3  
Old 01-15-2004
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
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
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
how to i add the user to the group?
# 7  
Old 01-15-2004
I would just "vi /etc/group". But you can use:
usermod -G groupname username

Previous Thread | Next Thread
Test Your Knowledge in Computers #112
Difficulty: Easy
macOS was not the largest Unix largest installed base in 2017.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Scripting - CHMOD issue

Hi Friends , good morning . I am very new to Unix scripting and require a bit of advice to help resolve the below issue . Hope some one can provide some suggestion I have the below script which calls a Oracle stored procedure which inturn extracts data from a table and writes in a ascii... (4 Replies)
Discussion started by: J1nx007
4 Replies

2. Homework & Coursework Questions

user rights

good evening .. I have a plea, who I can help me with a management application user rights on the files in a Unix / Linux I need for college .. .. and not told us no clue .. thank you (1 Reply)
Discussion started by: alex90
1 Replies

3. UNIX and Linux Applications

What is the difference between chmod in solaris and chmod in Linux?

i think it is the same in both... Iam i right? (1 Reply)
Discussion started by: sumaiya
1 Replies

4. Shell Programming and Scripting

Change Rights Recursive with chmod

Hello, i want just to change Rights for a few direcories anf files, but some directories must be exclude. How can i put the command chmod as chmod -R 755 * exclude toto tata where toto and tata are directories Could you help me for that or must I use the find command Thanks (2 Replies)
Discussion started by: steiner
2 Replies

5. Red Hat

Dansguardian Access rights

well hi to all The thing is I need to allow particular site to just one or 2 user not to everybody. Can anybody tell me how do i do it. If i put there ip in exception then whole Restriction would be bypassed which i dont want. Your Responses would be highly appreciated THANKS in ADVANCE (0 Replies)
Discussion started by: achtani_jeetu
0 Replies

6. Shell Programming and Scripting

rights to FTP user

hi i want create a user to ftp (get) files from the 2nd machine. but i want to give specific rights to that user that he can't access only specific files and directories. please suggest (1 Reply)
Discussion started by: dodasajan
1 Replies

7. UNIX for Dummies Questions & Answers

Access Rights

Hello Guru, I have very unique requirement , need some help. I have one folder created in one the server A. In this folder , the file getting uploaded from some java based page. then i am calling scp through key file, which works fine in another folder of server B. Currently , what i am... (2 Replies)
Discussion started by: u263066
2 Replies

8. Solaris

FTP rights

How can I prevent some users from using FTP? (2 Replies)
Discussion started by: Burhan
2 Replies

9. HP-UX

User rights

I wan to create a user e.g. Tom. whenever a file is created by user Tom or FTP is done using user as Tom, the rights on the file should be 777 (by default). how can I achieve this. Please help. Its very urgent. (1 Reply)
Discussion started by: sharmavr
1 Replies

10. UNIX Desktop Questions & Answers

Groups Rights

I just created a group. How do i make the groups read only to a specific file systems.(home directory). (3 Replies)
Discussion started by: niasdad
3 Replies

Featured Tech Videos