- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Setting Execute-Only Permission on a Unix Shel...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 08:32 AM
тАО01-18-2007 08:32 AM
Setting Execute-Only Permission on a Unix Shell Script for Group & Others
I would like the group and "others" to be able to just execute my shell script, but not be able to read the shell script.
Could you tell me how I could accomplish it?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 08:35 AM
тАО01-18-2007 08:35 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 08:39 AM
тАО01-18-2007 08:39 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
would give perms of --x--x--x for the file
Nobody could read/write the file (except root, of course)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 08:40 AM
тАО01-18-2007 08:40 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
cat /etc/lp/interface/myshell.sh
cat: Cannot open /etc/lp/interface/myshell.sh: Permission denied
The above is what I need but:
./myshell.sh
./myshell.sh: Cannot find or open the file.
But, I want to be able to execute.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 08:40 AM
тАО01-18-2007 08:40 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
You can't. Shell scripts must be *readable* and executable to be executable (unless you are the root user). The shell interpreter (as specified on the "she-bang" line) must be able to read the file to interpret and execute it.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 08:41 AM
тАО01-18-2007 08:41 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
jtraigle$ ls -l test.sh
-rwx--x--x 1 root sys 35 Jan 18 15:39 test.sh
jtraigle$ ./test.sh
/usr/bin/sh: ./test.sh: Cannot find or open the file.
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 08:45 AM
тАО01-18-2007 08:45 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 09:05 AM
тАО01-18-2007 09:05 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
ps: When I run the script, I login as a non-root user.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 09:06 AM
тАО01-18-2007 09:06 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 09:13 AM
тАО01-18-2007 09:13 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
http://searchopensource.techtarget.com/tip/0,289483,sid39_gci1216976,00.html
There is a package called SHC that may be of some use to you. I have not used it, but rather just found it via google.
SHC 2.4a
http://hpux.connect.org.uk/hppd/hpux/Shells/shc-2.4a/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 09:27 AM
тАО01-18-2007 09:27 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
You could configure sudo to take care of it by allowing certain users to execute the script as the scripts owner and set the script permissions to read and execute only for the owner.
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 10:33 AM
тАО01-18-2007 10:33 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
Of course, you'd have to go through the time & effort to set up "sudo" on the server - but it is useful for many things, and therefore it would pay you back for your effort(s) over time anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 10:39 AM
тАО01-18-2007 10:39 AM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
I just noticed Jeff's posting re: sudo. Excuse the posting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2007 01:06 PM
тАО01-18-2007 01:06 PM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2007 10:23 PM
тАО01-19-2007 10:23 PM
Re: Setting Execute-Only Permission on a Unix Shell Script for Group & Others
As mentioned by others, you need read permission.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2007 12:47 PM
тАО01-20-2007 12:47 PM