- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: execute files without read permission
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
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
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
тАО03-24-2004 02:37 AM
тАО03-24-2004 02:37 AM
Does anyone knows know I can put a file without read permission, but with execution permission.... I want this because I don't want the user see inside the file.
Is it possible?
Thanks!
Carmen.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:40 AM
тАО03-24-2004 02:40 AM
Re: execute files without read permission
# chmod 100 file
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:40 AM
тАО03-24-2004 02:40 AM
Re: execute files without read permission
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:41 AM
тАО03-24-2004 02:41 AM
Re: execute files without read permission
Yes it is possible. Set the permissions of the file accordingly.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:42 AM
тАО03-24-2004 02:42 AM
Re: execute files without read permission
I put
chmod 070 to /tmp/prova.txt
-----x--- 1 root oinstall 47 24 Mar 16:33 prova.txt
But If I do:
[:oracle]/tmp> ./prova.txt
ksh: ./prova.txt: cannot open
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:44 AM
тАО03-24-2004 02:44 AM
Re: execute files without read permission
root can execute a script with no read permissions because in reality root can read ANYTHING.
Thats because its all powerful.
On a practical level, it might help to know what you are trying to accomplish.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:44 AM
тАО03-24-2004 02:44 AM
Re: execute files without read permission
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:46 AM
тАО03-24-2004 02:46 AM
Re: execute files without read permission
There are some utilities which can compile your shell script into a true executable; the commercial versions work quite well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:46 AM
тАО03-24-2004 02:46 AM
Re: execute files without read permission
Made a small script with ls -la permissions 100 --x------ rj
/tmp/r# more rj
ls -la
/tmp/r# ls -la
total 48
drwxr-xr-x 2 root sys 1024 Mar 24 16:39 .
drwxrwxrwx 8 bin bin 22528 Mar 24 16:44 ..
---x------ 1 root sys 7 Mar 24 16:44 rj
/tmp/r# ./rj
total 48
drwxr-xr-x 2 root sys 1024 Mar 24 16:39 .
drwxrwxrwx 8 bin bin 22528 Mar 24 16:44 ..
---x------ 1 root sys 7 Mar 24 16:44 rj
Regards
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:48 AM
тАО03-24-2004 02:48 AM
Re: execute files without read permission
But you are "root". As SEP said, root can read "unreadable" files. Try is as a non-root user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:49 AM
тАО03-24-2004 02:49 AM
Re: execute files without read permission
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:52 AM
тАО03-24-2004 02:52 AM
Re: execute files without read permission
How does work SETUID root wrapper program??
Could you put me an example??
Thanks!
Carmen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:56 AM
тАО03-24-2004 02:56 AM
Re: execute files without read permission
Does you know the name of one utility of its??
Thanks!!
Carmen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:58 AM
тАО03-24-2004 02:58 AM
Solutionmain(){
system("
save as mywrapper.c
Compile with cc -s -o mywrapper mywrapper.c
chown root mywrapper
chmod 6755 mywrapper
In my view, this is a worse security hazard than allowing people to read your script (particulary using system()) but it might be enough for your needs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2004 02:58 AM
тАО03-24-2004 02:58 AM
Re: execute files without read permission
that is what Clay tried to explain.
root can read everything so no need for read rights. As normal user your script needs these rights to work:
-x-x------ 1 user group 7 Mar 24 16:44 rj
But I have another solution for you carmen. If you don't want that a user can look in a script, because of a password in the script you can use the script compiler shc from
http://big.asknet.de/ for me it works fine.
But when your script MUST run under root rights you should try sudo.
Roland
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2004 01:23 AM
тАО03-26-2004 01:23 AM
Re: execute files without read permission
I have prove the script compiler shc from
http://big.asknet.de/, but it shows me:
> shc -f prova.sh
shc Invalid script's first line: #/bin/ksh
shc: Error 0
so, I have prove to do:
int main()
{
system("prova.sh");
}
and it's works fins.
Thanks everybody!!!
Carmen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2004 01:33 AM
тАО03-26-2004 01:33 AM
Re: execute files without read permission
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2004 01:36 AM
тАО03-26-2004 01:36 AM
Re: execute files without read permission
Roland