Visit Our UNIX and Linux User Community

Permission to the script.

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Permission to the script.
# 1  
Old 08-12-2013
Permission to the script.

I have written a script and now i want to deploy it in PRODUCTION.

I want to give all the permission to the user only but not to others.What permission should i use?

# 2  
Old 08-12-2013
If you want to give all permission to the user only (including read, write and execute), you could chmod 0700 the script and make sure you chown and chgrp the file (script) ownership to the user you want to give it out to.
# 3  
Old 08-12-2013

Please use code tags for posting commands. Please use the following command to give permissions to user for script and not to others.
But you can take a test in QA onced before putting in PR please.

-rwx--x--x    1 singh1 users           548 Aug 09 10:42 date_solution.ksh
$ chmod 711 date_solution.ksh

$ ls -ltr | grep "date_solution.ksh"
-rwx--x--x    1 singh1 users           548 Aug 09 10:42 date_solution.ksh

Just an example for a file is given above.

R. Singh
# 4  
Old 08-12-2013
Typical permissions are
700 read/execute/write permission for the file's owner, ls -l shows rwx------
750 ... plus read/execute for the file's group, ls -l shows rwxr-x---
755 ... plus read/execute for others, ls -l shows rwxr-xr-x

@Ravinder: 711 does not make sense for a script.
This User Gave Thanks to MadeInGermany For This Post:
# 5  
Old 08-12-2013
Hello MadeInGermany,

I just wanted to give execute permissions to others. Please correct me if I am wrong here, I will be grateful to you.

R. Singh
# 6  
Old 08-12-2013
You don't need execute permission to be able to execute a script, but you certainly can't execute it if you can't read it.
# 7  
Old 08-12-2013
Thanks Scott and MadeInGermany for explaining me the same.

R. Singh

Previous Thread | Next Thread
Test Your Knowledge in Computers #441
Difficulty: Easy
"Hotel California" by the Eagles is a song about a super A.I. who goes rouge and parties all day and night.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute permission for shell script

Hi All, I am not able to figure out what is the problem with calling a shell script within a shell script. i have given all the permissions to both schell scripts. but when i am seeing the log file error is coming like ./ Execute... (9 Replies)
Discussion started by: krupasindhu18
9 Replies

2. Shell Programming and Scripting

shell script and Permission denied

Have the following in a .sh file. printf "Installing ... \ r" cd $ ORG_DIR / a_a . / configure> error.log Make 1> error.log 2> error.log make install> error.log But when I run I get the following. line 270:. / configure: Permission denied make: *** No rule two make target... (3 Replies)
Discussion started by: Mumie
3 Replies

3. Shell Programming and Scripting

looking for help on script to capture file permission.

Hi Guys, I'm a DBA and need help on shell scripting. My Oracle Database is sitting on HP-UX machine. Anyone has a script that can spool out permission of all oracle binary files in the below directory: /opt/ora10g/oracle/ Format to be spooled out : chmod <exisiting permission> filename... (10 Replies)
Discussion started by: ciaciachew
10 Replies

4. Shell Programming and Scripting

permission script

hi guys I am working on a menu... and the menu has some options like check status for services (gmonitor group) or stop - start - restart those same services (gadmin group) as you see there are 2 main groups gmonitor for monitoring and gadmin for restart - stop - start services so... (2 Replies)
Discussion started by: karlochacon
2 Replies

5. Shell Programming and Scripting

simple bash script permission

I have a bash script, but it needs to have a simple protection with password. So if a user wants to run the script , there should be a kdialog to asks for a password.If the password is correct the script starts to run. It should not be the passord of root or another admin user.Just a password in... (2 Replies)
Discussion started by: poort
2 Replies

6. Solaris

Rc script permission problem

Hi, I have written a startup script which has be started while reboot. I am using Solaris10 machine and i have logged in as a root user. I have written a code the following code cp ./StartService /etc/init.d/ chmod 744 /etc/init.d/StartService //i have given it executable permissions... (3 Replies)
Discussion started by: raghu.amilineni
3 Replies

7. Shell Programming and Scripting

Rc script permission problem

Hi, I have written a startup script which has be started while reboot. I am using Solaris10 machine and i have logged in as a root user. I have written a code the following code cp ./StartService /etc/init.d/ chmod 744 /etc/init.d/StartService //i have given it executable... (0 Replies)
Discussion started by: raghu.amilineni
0 Replies

8. UNIX for Advanced & Expert Users

Script without read permission but execute the script

I have a script, except me no one can read the script but they can execute the script. Is it possible? (14 Replies)
Discussion started by: kingganesh04
14 Replies

9. UNIX for Dummies Questions & Answers

script permission error

I am writing a VERY simple script that copies my catalina log file to a new filename then copies /dev/null inotthe catalina.out. Since the log is the live log, it is open and written to as I copy. I can do the 2 copy commands from a command promp with no problem, it works. I have the probmel in... (2 Replies)
Discussion started by: rschille
2 Replies

10. Shell Programming and Scripting

file permission script

Hi all, I need one script, that will give the out put like all files having 777 permissions and full path from home directory. example:i created 777 permissions files three in my home directory and subdirectories also. i want out put like ./xxxxx/aaa.txt ./xxxxx/zzz/yyy.txt ... (3 Replies)
Discussion started by: krishna176
3 Replies

Featured Tech Videos