Operating System - HP-UX
1834188 Members
2602 Online
110064 Solutions
New Discussion

Re: how assign permission to users.

 
Ramana.Sv
Frequent Advisor

how assign permission to users.

im using HP-UX , i created use but how to ssign permission to user. buz when i create a file or execute a file its giving the don't have permission. please help how to assign permission to users.

Thank you,
Ramana
6 REPLIES 6
Oviwan
Honored Contributor

Re: how assign permission to users.

Hey

change owner of a file:
#chown username filename
change group of a file
#chgrp groupname filename
change permission
#chmod 751 filename

for more infos check the manpages of each command

Regards
Dennis Handly
Acclaimed Contributor

Re: how assign permission to users.

>Oviwan: change owner of a file:

chown(1) can also change the group:
$ chown username:groupname filename

>#chmod 751 filename

You can also use symbolic names:
$ chmod u=rwx,g=rx,o=x filename

If you just want to add execute to everyone:
$ chmod a+x filename
AwadheshPandey
Honored Contributor

Re: how assign permission to users.

you can also use chmod +/- r/w/x file/dir to add or remove permissions.
here r stands for read, w for write and x for execute.
It's kind of fun to do the impossible
Ramana.Sv
Frequent Advisor

Re: how assign permission to users.

sorry for not clear the qietion, my question is =, i created one user i logedin into that user and created one files executing or compling some thing, its giving error user does not have permission to execute, how to assign the permission to user.
thank you,
Rmana
Dennis Handly
Acclaimed Contributor

Re: how assign permission to users.

>it's giving error user does not have permission to execute, how to assign the permission to user.

(Typically you assign permission first to the file.)

You are going to have to show the command and error message

If you linked and got unsats, your executable won't have execute permission.
If you create a script, you have to add execute permission.
Oviwan
Honored Contributor

Re: how assign permission to users.

Here the scenario:

$ touch blah.sh
$ ./blah.sh
sh: ./blah.sh: Execute permission denied.
$ ll blah.sh
-rw-r--r-- 1 oracle dba 0 Aug 3 12:55 blah.sh
$ chmod 751 blah.sh
$ ll blah.sh
-rwxr-x--x 1 oracle dba 0 Aug 3 12:55 blah.sh
$ ./blah.sh

hope this helps