How do I change security on a file or directory?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How do I change security on a file or directory?
# 1  
Old 01-06-2002
Question How do I change security on a file or directory?

What command(s) do I use to change the security on a file? I need to change the owner as well as read write end execute options.
# 2  
Old 01-06-2002
The chown command will change the owner

chown newowner filename

The chmod command will change the permissions. Permissions are specified as an octal number that can go from 000 to 777.
The read bit is decimal 4, the write bit is decimal 2, and the execute bit is decimal 1. Assuming you want rwx for owner, r-x for group, and r-x for other (decimal 755), the command would be

chmod 755 filename
# 3  
Old 01-06-2002
A hint if you're trying to find information on any command - use the man page.

Just type in "man command_name".

Now if you don't know what the command is - as I figure you didn't in this instance - then try using "man -k search_word"

The -k does a keyword search through man and gives you a list of instances where this keyword is in the command name or command description....i.e for the "permissions" on a file

$ man -k permissions
chmod chmod (1) - change the permissions mode of a file
fbtab logindevperm (4) - login-based device permissions
logindevperm logindevperm (4) - login-based device permissions
uucheck uucheck (1m) - check the uucp directories and permissions file
# 4  
Old 01-06-2002
MySQL Thank you for your help

Very helpful information. I especially like the man -k tip. Thank you very much.
# 5  
Old 02-21-2002
Re: How do I change security on a file or directory?

I have some cgi scripts that created directories and files owned by "nobody". How do I change the "nobody" owner to mine so that I can edit some files in the dir manually?

Do I need to run another cgi script to change the permission from web browser (chmod 777 ??) ?

Thanks.
# 6  
Old 02-21-2002
You would either need root access (to change ownership from "nobody" to you), or perhaps it may work to jot out a quick CGI that would chmod or chown the files... Since it looks like it's being run as "nobody", it should be able to change the files for you.

Let us know...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Change directory for core file

Hi, Some of the process in th environment are producing a core file. These core files are produced by default in the directory from which they were launched. I want to change the default directory to say /tmp of that environment. I am using both Linux and Solaris, so will need the solution... (2 Replies)
Discussion started by: Raj999
2 Replies

2. Shell Programming and Scripting

Change to directory and search some file in that directory in single command

I am trying to do the following task : export ENV=aaa export ENV_PATH=$(cd /apps | ls | grep $ENV) However, it's not working. What's the way to change to directory and search some file in that directory in single command Please help. (2 Replies)
Discussion started by: saurau
2 Replies

3. UNIX for Dummies Questions & Answers

How to change database directory to another directory?

Hi, I Installed mysql on my CentOS 6.2 Server. But when I tried to change the location of /var/lib/mysql to another directory. I can't start the mysql. Below is what I've done yum install mysql mysql-server mysql-devel mkdir /path/to/new/ cp -R /var/lib/mysql /path/to/new chown -R... (1 Reply)
Discussion started by: ganitolngyundre
1 Replies

4. AIX

/etc/security/limits value change

Hello, I have changed the value for one user in /etc/security/limit via root user as paul: time(seconds) unlimited file(blocks) 2097151 data(kbytes) unlimited stack(kbytes) unlimited memory(kbytes) unlimited coredump(blocks) unlimited ... (3 Replies)
Discussion started by: saurabh84g
3 Replies

5. Shell Programming and Scripting

How can we change the permissions of a file in a directory

Hi All, I am trying to wite a Shell script which changes the permission of the files in a folder but stuck at a particular point,please help. The scenario is as follwoing: I am having a list of 10 files and a folder which has 100 files. I need to copare the list and the folder ,for... (4 Replies)
Discussion started by: Sriram.Vedula53
4 Replies

6. AIX

Security user Can't change the groups.

Dears Security users in AIX don’t have permission to change the group of the user thru Smitty Users When they try to change the group of the users to any group they'll get permission denied Security profile in Smitty : User... (10 Replies)
Discussion started by: ITHelper
10 Replies

7. Cybersecurity

Directory of Security Links (Software Tools)

Hello, If you are interested in security, check out this new directory of unix and linux related software tools. Security - Links If you have any of your favorite tools, feel free to add them to the directory. (0 Replies)
Discussion started by: Neo
0 Replies

8. UNIX for Dummies Questions & Answers

Change All File Names in a Directory

Hi, If I have a directory full of say 100 random files, and I would like to organize them, for example: FILE001, FILE002, FILE003, FILE004, etc. How would I do this from Terminal, instead of manually changing each file? I'm using Mac OS X, if that makes a difference. Thank you in advance... (8 Replies)
Discussion started by: andou
8 Replies

9. UNIX for Advanced & Expert Users

home directory security

Hi, we have an FTP Server running on Unix. Users' home directories are protected with 700 permissions and all working fine. Recently we got a requirement to allow everyone to upload new files (not to overwrite existing files, of course) into others' home directories but without having provided... (5 Replies)
Discussion started by: prvnrk
5 Replies
Login or Register to Ask a Question