Anda di halaman 1dari 4

Gestiunea utilizatorilor si grupelor

Comenzi Linux
1) Id - prints information for a certain user SYNTAX id [-a] [-G] [-g] [-u] [user]

-a -G

Reports user name, use ID and all the groups to which the user belongs. Output all different group IDs (effective, real and supplementary) only, using the format "%u\n". If there is more than one distinct group affiliation, output each such affiliation, using the format " %u", before the new line character is output. Output only the effective group ID, using the format "%u\n". Output the name in the format "%s" instead of the numeric ID using the format "%u". Output the real ID instead of the effective ID. Output only the effective user ID, using the format "%u\n". The user (login) name for which information is to be written.

-g -n -r -u user

2) Useradd - Enables a super user or root to create a new user or updates default new user information. SYNTAX

useradd [-c comment] [-d home_dir] [-e expire_date] [-f inactive_time] [-g initial_group] [-G group[,...]] [-m [-k skeleton_dir]] [-p passwd] [-s shell] [-u uid [ -o]] login useradd -D [-g default_group] [-b default_home] [-f default_inactive] [-e default_expire_date] [-s default_shell] -c comment -d home_dir The new user's password file comment field. The new user will be created using home_dir as the value for the user's login directory. The default is to append the login name to default_home and use that as the login directory name. The date on which the user account will be disabled. The date is specified in the format YYYY-MM-DD. The number of days after a password expires until the account is permanently disabled. A value of 0 disables the account as soon as the password has expired, and a value of -1 disables the feature. The default value is -1. The group name or number of the user's initial login group. The group name must exist. A group number must refer to an already existing group. The default group number is 1. A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace. The groups are subject to the same restrictions as the group given with the -g option. The default is for the user to belong only to the initial group.

-e expire_date -f inactive_time

-g initial_group

-G group,[,...]

-m

The user's home directory will be created if it does not exist. The files contained in skeleton_dir will be copied to the home directory if the -k option is used, otherwise the files contained in /etc/skel will be used instead. Any directories contained in skeleton_dir or /etc/skel will be created in the user's home directory as well. The -k option is only valid in conjunction with the -m option. The default is to not create the directory and to not copy any files. The encrypted password, as returned by crypt. The default is to disable the account. The name of the user's login shell. The default is to leave this field blank, which causes the system to select the default login shell. The numerical value of the user's ID. This value must be unique, unless the -o option is used. The value must be non-negative. The default is to use the smallest ID value greater than 99 and greater than every other user. Values between 0 and 99 are typically reserved for system accounts. The initial path prefix for a new user's home directory. The user's name will be affixed to the end of default_home to create the new directory name if the -d option is not used when creating a new account.

-p passwd -s shell -u uid

-b default_home

-e The date on which the user account is disabled. default_expire_date -f default_inactive -g default_group -s default_shell The number of days after a password has expired before the account will be disabled. The group name or ID for a new user's initial group. The named group must exist, and a numerical group ID must have an existing entry. The name of the new user's login shell. The named program will be used for all future new user accounts.

3) Groupadd - Creates a new group account. SYNTAX

groupadd [-g gid [-o]] group -g gid The numerical value of the group's ID. This value must be unique, unless the -o option is used. The value must be non-negative. The default is to use the smallest ID value greater than 99 and greater than every other group. Values between 0 and 99 are typically reserved for system accounts.

4) Passwd - Allows you to change your password. SYNTAX

passwd [-r | files | -r nis | -r nisplus ] [-a] [-d | -l] [-e] [-f] [-g] [-h] [-n min] [-s] [-w warn] [-x max] [D domainname][ name ] -r -a Specifies the repository to which an operation is applied. The supported repositories are files, nis or nisplus. Show password attributes for all entries. Use only with the -s option; name must not be provided. For the nisplus repository, this will show only the entries in the NIS+ password

table in the local domain that the invoker is authorized to "read". -d -l -e -f -g -h -n min Deletes password for name. The login name will not be prompted for password. It is only applicable to the files repository. Locks password entry for name. Change the login shell. For the files repository, this only works for the super-user. Normal users may change the nis or nisplus repositories. Force the user to change password at the next login by expiring the password for name. Change the gecos (finger) information. For the files repository, this only works for the superuser. Normal users may change the nis or nisplus repositories. Change the home directory. Set minimum field for name. The min field contains the minimum number of days between password changes for name. If min is greater than max, the user may not change the password. Displays information including your username and if you do/don't have a password (This command will not actually show the password.) Set warn field for name. The warn field contains the number of days before the password expires and the user is warned. This option is not valid if password aging is disabled. Set maximum field for name. The max field contains the number of days that the password is valid for name. The aging for name will be turned off immediately if max is set to -1. If it is set to 0, then the user is forced to change the password at the next login session and aging is turned off. Consult the passwd.org_dir table in domainname. If this option is not specified, the default domainname returned by nis_local_directory(3N) will be used. This domain name is the same as that returned by domainname(1M). Login ID of user

-s -w warn -x max

-D domainname

name

5) Userdel - Enables a super user to remove a users account. SYNTAX

userdel [-r] login -r Files in the user's home directory will be removed along with the home directory itself and the user's mail spool. Files located in other file systems will have to be searched for and deleted manually.

Comenzi Windows
1) Net user - add a new user account to the domain or groups SYNTAX net user username {password | *} /ADD [options] [/DOMAIN] Example: net user John fadf24as /ADD /DOMAIN 2) NET GROUP - Add, delete, view, and otherwise manage network workgroups. SYNTAX [groupname [/COMMENT:"text"]] [/DOMAIN] groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN] groupname username [...] {/ADD | /DELETE} [/DOMAIN] 3) NET LOCALGROUP - Add, delete, view, and otherwise manage network groups. SYNTAX [groupname [/COMMENT:"text"]] [/DOMAIN] groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN] groupname name [...] {/ADD | /DELETE} [/DOMAIN] 4) NET ACCOUNTS - Adjust account settings. SYNTAX [/FORCELOGOFF:{minutes | NO}] [/MINPWLEN:length] [/MAXPWAGE:{days | UNLIMITED}] [/MINPWAGE:days] [/UNIQUEPW:number] [/DOMAIN] 5) NET PASSWORD - Changes your logon password. SYNTAX NET PASSWORD [oldpassword [newpassword]] NET PASSWORD \\computer | /DOMAIN:name [user [oldpassword [newpassword]]]

oldpassword Specifies your current password. newpassword Specifies your new password. It can have as many as 14 characters. computer Specifies the Windows NT or LAN Manager server on which you want to change your password. /DOMAIN Specifies that you want to change your password on a Windows NT or LAN Manager domain. Name Specifies the Windows NT or LAN Manager domain on which you want to change your password. user Specifies your Windows NT or LAN Manager user name. The first syntax line above is for changing the password for your password-list file. The second syntax line above is for changing your password on a Windows NT or LAN Manager server or domain.

Anda mungkin juga menyukai