06-04-2002
do a "man chmod" it will list a commands with derivitives for you to set a file permission.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a very simple question which I am not able to crack.
There is an user with same username and groupname. How do I change permissions of a file to have the username and groupname assigned for the user "test". Appreciate you help.
-Carl (1 Reply)
Discussion started by: calredd
1 Replies
2. UNIX for Dummies Questions & Answers
Hi ,
I have a situation where plenty of users log in to the same directory and put in files. When they put in the files, I need those files to become group writable (chmod g+w) automatically. I have no control over the users' profiles. Is there a way to do it? (1 Reply)
Discussion started by: praveen_indramo
1 Replies
3. UNIX for Dummies Questions & Answers
Hi everyone,
There are couple of users of which i need to give 2 of the users admin rights so that they are able to run the administration commands like "zoneadm" and locale.
When logged in as root i am obviously able to do that.please suggest any way by which the other 2 user's permissions... (1 Reply)
Discussion started by: sankasu
1 Replies
4. UNIX for Dummies Questions & Answers
Hi everyone,
There are couple of users of which i need to give 2 of the users admin rights so that they are able to run the administration commands like "zoneadm" and locale.
When logged in as root i am obviously able to do that.please suggest any way by which the other 2 user's permissions can... (3 Replies)
Discussion started by: sankasu
3 Replies
5. UNIX for Dummies Questions & Answers
while trying to view the access permissions to file by "ls -lrt" command it is opening some files int the dir after that segmentation fault ie core is generarting the dir.will anybody please what is the problem. (1 Reply)
Discussion started by: rajkumar_g
1 Replies
6. Shell Programming and Scripting
Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies
7. UNIX for Dummies Questions & Answers
Is there any option with mv or cp command so that a file permissions and name of the file can be changed in single mv or cp command. I searched man mv but doesn't found any option like that. (3 Replies)
Discussion started by: Devesh5683
3 Replies
8. UNIX for Dummies Questions & Answers
Hi everyboy,
I've installed a Virtualbox on my computer, inside the VB i'm running RedHat.
So my problems it's that i need to run the scripts runasroot.sh to install the guest addiont, i'm doing this by console. I wrote chmod 775 ./runasroot.sh but doesn't works. I'm login as root user.
Any... (8 Replies)
Discussion started by: Newer
8 Replies
9. Shell Programming and Scripting
Hi All
I have the following script that is supposed to change permissions of incoming files to a directory, but it does not seem to do what I want, please can you help:
mkdir -p /tmp/tmpdir
find /moneta_polled01/sgsn/ -exec ls -l {} \; |grep -v rwxrwxrwx |awk '{print $9}' >... (4 Replies)
Discussion started by: fretagi
4 Replies
10. Solaris
Hi!
I have a dir in a server, that receives files with the wrong permissions, so I decide to put on a cron entry that changes its permitions, but because of the time gap, not all of them get changed.
What I did was the following:
... (14 Replies)
Discussion started by: fretagi
14 Replies
LEARN ABOUT CENTOS
keyctl_setperm
KEYCTL_SETPERM(3) Linux Key Management Calls KEYCTL_SETPERM(3)
NAME
keyctl_setperm - Change the permissions mask on a key
SYNOPSIS
#include <keyutils.h>
long keyctl_setperm(key_serial_t key, key_perm_t perm);
DESCRIPTION
keyctl_setperm() changes the permissions mask on a key.
A process that does not have the SysAdmin capability may not change the permissions mask on a key that doesn't have the same UID as the
caller.
The caller must have setattr permission on a key to be able change its permissions mask.
The permissions mask is a bitwise-OR of the following flags:
KEY_xxx_VIEW
Grant permission to view the attributes of a key.
KEY_xxx_READ
Grant permission to read the payload of a key or to list a keyring.
KEY_xxx_WRITE
Grant permission to modify the payload of a key or to add or remove links to/from a keyring.
KEY_xxx_SEARCH
Grant permission to find a key or to search a keyring.
KEY_xxx_LINK
Grant permission to make links to a key.
KEY_xxx_SETATTR
Grant permission to change the ownership and permissions attributes of a key.
KEY_xxx_ALL
Grant all the above.
The 'xxx' in the above should be replaced by one of:
POS Grant the permission to a process that possesses the key (has it attached searchably to one of the process's keyrings).
USR Grant the permission to a process with the same UID as the key.
GRP Grant the permission to a process with the same GID as the key, or with a match for the key's GID amongst that process's Groups
list.
OTH Grant the permission to any other process.
Examples include: KEY_POS_VIEW, KEY_USR_READ, KEY_GRP_SEARCH and KEY_OTH_ALL.
User, group and other grants are exclusive: if a process qualifies in the 'user' category, it will not qualify in the 'groups' category;
and if a process qualifies in either 'user' or 'groups' then it will not qualify in the 'other' category.
Possessor grants are cumulative with the grants from the 'user', 'groups' and 'other' categories.
RETURN VALUE
On success keyctl_setperm() returns 0 . On error, the value -1 will be returned and errno will have been set to an appropriate error.
ERRORS
ENOKEY The specified key does not exist.
EKEYEXPIRED
The specified key has expired.
EKEYREVOKED
The specified key has been revoked.
EACCES The named key exists, but does not grant setattr permission to the calling process.
LINKING
This is a library function that can be found in libkeyutils. When linking, -lkeyutils should be specified to the linker.
SEE ALSO
keyctl(1),
add_key(2),
keyctl(2),
request_key(2),
keyctl(3),
request-key(8)
Linux 4 May 2006 KEYCTL_SETPERM(3)