Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting execute permission only

Status
Not open for further replies.

sumncguy

IS-IT--Management
May 22, 2006
118
US

Is it possible to set execute only ?

chmod a+x,a-r,u+r <script.sh>. User will be able to execute, but will everyone else ?

Thanks
 
Is it possible to set execute only ?
Yes, try:
chmod 111 <script.sh>

chmod a+x,a-r,u+r <script.sh>. User will be able to execute, but will everyone else ?
Yes, a+x sets User (owner), Group and All others to execute.

For User (owner) only to execute only, try:
chmod 100 <script.sh>


I hope that helps.

Mike
 
To execute a script you need the execute and read bits on. So "[tt]chmod 555 script.sh[/tt]" is the least you can have.

The execute bit alone is most useful for directories. You can hide a directory but still let people access it. If you do this...
Code:
mkdir /secret
mkdir /secret/one
mkdir /secret/two
mkdir /secret/two/three
chmod 111 /secret
chmod 777 /secret/one
chmod 711 /secret/two
chmod 777 /secret/two/three
When someone does...
[tt]
ls /secret # it will fail
ls /secret/one # it will succeed
ls /secret/two # it will fail
ls /decret/two/three # it will succeed
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top