- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- making a file/script unreadable to others
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
Forums
Discussions
Discussions
Discussions
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
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
04-12-2002 10:58 AM
04-12-2002 10:58 AM
making a file/script unreadable to others
Thanks in advance
Narasimham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2002 11:32 AM
04-12-2002 11:32 AM
Re: making a file/script unreadable to others
Give this permission to your file script:
-rwx--x--x
See the manual abouth chmod. man chmod
Frank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2002 11:32 AM
04-12-2002 11:32 AM
Re: making a file/script unreadable to others
chmod 711 scriptfilename
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2002 11:56 AM
04-12-2002 11:56 AM
Re: making a file/script unreadable to others
There is a "dirty" way to achieve what you want. You need to establish your script as a 'setuid' script. Consider this script:
#/usr/bin/sh
id
exit 0
Call the script 'my.sh' and do:
# chown root my.sh
# chmod 4111 my.sh
*Anyone* can now execute the script, but only 'root' can read or write the script.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2002 12:16 PM
04-12-2002 12:16 PM
Re: making a file/script unreadable to others
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2002 12:16 PM
04-12-2002 12:16 PM
Re: making a file/script unreadable to others
To add to JRF's good answer...
Not only is it a good practice to specify the command / shell to use to interpret the script on the first line of the script, it is required for JRF's answer to work.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2002 11:46 PM
04-12-2002 11:46 PM
Re: making a file/script unreadable to others
This used to not be the case, but many unix developers have decided to allow it.
I would try and avoid SUID scripts if possible - simply because they allow the possibility of security flaws such as race conditions, break-outs etc...
dave