Don't want to use useradd command to create a new user
I am doing manual addition of accounts. Actually I am writing a script and I am working on RedHat7.1 system. What I am trying to do is run the script and pass all the values of the username password and group as command line parameters. Now... (2 Replies)
Can any one tell me if i dun want using 'useradd' command to add new user, it is have any command i can use to add a new user?and any extra step needed for my local environment? (3 Replies)
Hi
Reqmt: I am working on Sys 1 and passes a command to Sys2 using a utility which has ssh coded in it. Is there any way to get the process id of the command in Sys 2 from my Sys1 ? Note: The utility is not editable, so you cannot get it through it and I am not logged in in Sys2.
Thanks... (2 Replies)
This is one our office BOX
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
Kisses% rlogin pebblz01 -l adminID
Password:
Last login: Sat Feb 14 01:11:36 from Kisses
Please enter your own login id and password.
Your login: I_rule
Your password:xxxxx
From the above... (3 Replies)
Hi there,
One can easily retrieve the uid from a username :
id -u $username
But how can we easily retrieve the gid from a group name?
I mean is there a command without using sed?
sed -nr "s/^$groupname:x:(+):.*/\1/p" /etc/group
Thanks for your help
Santiago (7 Replies)
We had a mapping to one UNIX box just fine, the server was changed to another UNIX box and now when mapping drives from Windows box to new UNIX box, we get the old GID associated with our Windows user. When checking on new UNIX box, we see GID of 108, which is what we want, but when we map the... (0 Replies)
I´m listing the contents of a directory using the command
ls -lI get numeric uid and gid for some lines.
example:
drwxr-xr-x root root 1970-01-01 01:00 sys
-rw-r--r-- 501 20 0 2010-08-04 14:54 shutdown.bravo.rc
drwxr-x--- 501 20 ... (5 Replies)
Hi,
I want to create multiple user in same home directory.
Is it possible ?
If possible then please tell me how.
Thanks in advance. (3 Replies)
Discussion started by: mnmonu
3 Replies
LEARN ABOUT DEBIAN
capng_change_id
CAPNG_CHANGE_ID(3) Libcap-ng API CAPNG_CHANGE_ID(3)NAME
capng_change_id - change the credentials retaining capabilities
SYNOPSIS
#include <cap-ng.h>
int capng_change_id(int uid, int gid, capng_flags_t flag);
DESCRIPTION
This function will change uid and gid to the ones given while retaining the capabilities previously specified in capng_update. It is not
necessary and perhaps better if capng_apply has not been called prior to this function so that all necessary privileges are still intact.
The caller is required to have CAP_SETPCAP capability still active before calling this function.
This function also takes a flag parameter that helps to tailor the exact actions performed by the function to secure the environment. The
option may be or'ed together. The legal values are:
CAPNG_NO_FLAG
Simply change uid and retain specified capabilities and that's all.
CAPNG_DROP_SUPP_GRP
After changing id, remove and supplement groups that may come with the account.
CAPNG_CLEAR_BOUNDING
After changing the uid and gid, clear the bounding set regardless to the internal representation already setup.
RETURN VALUE
This returns 0 on success and a negative number on failure. -1 means capng has not been initted properly, -2 means a failure requesting to
keep capabilities across the uid change, -3 means that applying the intermediate capabilities failed, -4 means changing gid failed, -5
means dropping supplemental groups failed, -6 means changing the uid failed, -7 means dropping the ability to retain caps across a uid
change failed, -8 means clearing the bounding set failed, -9 means dropping CAP_SETPCAP failed.
Note: the only safe action to do upon failure of this function is to probably exit. This is because you are likely in a situation with par-
tial permissions and not what you intended.
SEE ALSO capng_update(3), capng_apply(3), prctl(2), capabilities(7)AUTHOR
Steve Grubb
Red Hat June 2009 CAPNG_CHANGE_ID(3)