1831462 Members
3140 Online
110025 Solutions
New Discussion

permission

 
SOLVED
Go to solution
kacou
Regular Advisor

permission

I want to give the permission 'read' on “/var/adm/sulog“ to the user Joe.
18 REPLIES 18
Pete Randall
Outstanding Contributor

Re: permission

So what's your question?


Pete

Pete
MarkSyder
Honored Contributor
Solution

Re: permission

Have you thought of using sudo? The file has the permissions it has for a reason.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
kacou
Regular Advisor

Re: permission

i know that the permission of the â /var/adm/sulogâ file is "-rw-------" then I want to give the permission 'read only' on â /var/adm/sulogâ to the user Joe, who conects using "su". help me please
Dennis Handly
Acclaimed Contributor

Re: permission

>i know that the permission of the /var/adm/sulog file is "-rw-------" then I want to give the permission 'read only' to the user Joe, who conects using "su".

You can give read only to everyone with:
chmod a+r /var/adm/sulog

Otherwise you'll need to create an ACL. See setacl(1), aclv(5):
http://docs.hp.com/en/B2355-60130/setacl.1.html
http://docs.hp.com/en/B2355-60130/aclv.5.html
Jeeshan
Honored Contributor

Re: permission

if you want to give permission to the user you can use what is mentioned above.

but alternatively you can apply ACL to that user only on that particular user.
a warrior never quits
Mustafa Gulercan
Respected Contributor

Re: permission

hi,

the owner of /var/adm/sulog is root.and permission is rw for owner.
if you want to read sulog with Joe user,
you can easly add the Joe user to the root group from /etc/group.

regards,
mustafa
Mustafa Gulercan
Respected Contributor

Re: permission

hi,
sorry for missing,
final step you must change permission -rw-rw---- sulog.

regards,
mustafa
kacou
Regular Advisor

Re: permission

can you give me the syntaxe, command?
Jeeshan
Honored Contributor

Re: permission

#chmod 550 sulog
a warrior never quits
kacou
Regular Advisor

Re: permission

syntaxe to add "joe" in the /etc/group
Pete Randall
Outstanding Contributor

Re: permission

1. vi /etc/group
2. locate the root group line
root::0:root
3. At the end of this line, add "joe"


Pete

Pete
Jeeshan
Honored Contributor

Re: permission

the /etc/group folder contains the goup name, not user name.
when you apply command
#groupadd
the groupname has been added in /etc/group file.

a warrior never quits
Pete Randall
Outstanding Contributor

Re: permission

From man 4 group:

group contains for each group the following information:

+ group name

+ encrypted password

+ numerical group ID

+ comma-separated list of all users allowed in the group


Pete

Pete
Mustafa Gulercan
Respected Contributor

Re: permission

hi,
#chmod 660 /var/adm/sulog
and edit the file /etc/group as following;

vi /etc/group
add the Joe user and of the line,
root::0:root,joe

regards,
mustafa
Torsten.
Acclaimed Contributor

Re: permission

Already mentioned by Mark earlier - why not using "sudo" to view the file???

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Sajjad Sahir
Honored Contributor

Re: permission


Dear Kacaou

regarding permission in simple way understand how to give permission

rwx
r is read
w is write
x is execute

x has the value 1
w has the value 2
and read has the value 4
and in which order we have to give
user-group-others
for example
if u are giving chmod 777 then permission of the file will be rwx-rwx-rwx means
read+write+execute(4+2+1) and u are giving these permission to the user, group and others, so everybody will get grant permission
based these calculation u can assign permission in simple way depends on requirement
thanks and regards

Sajjad

Dennis Handly
Acclaimed Contributor

Re: permission

>Sajjad: x has the value 1 ...
>based these calculation you can assign permission in simple way

Instead of using stinkin' numbers you can use the symbolic form.
The man page says this about the numeric form: (Obsolescent)

(You only have to know about numbers for the chmod ftp command.)
Torsten.
Acclaimed Contributor

Re: permission

Consoder this:
by adding Joe to the root user group you will grant access for Joe also to many other files.
Do you want to do this?

Again, I would suggest to setup a sudo-command for reading this particular file.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!