My Princess

Janya - My Life

My Co-Authors

Vaishali Shah
Ivan Bayross

My Publishers

Shroff Publishers

I work with

CyberSol Technologies

Web Directories

Directory India

Who's Online

We have 17 guests online
Linux Administration Commands PDF Print E-mail

Command

useradd

Purpose

Create a new user or update default new user information

Synopsis

useradd [options] login

useradd -D [options] login


Description:

When invoked without the -D option, the useradd command creates a new user account using the values specified on the command line and the default values from the system. The new user account will be entered into the system files as needed, the home directory will be created, and initial files copied, depending on the command line options. The version provided with Red Hat Linux will create a group for each user added to the system, unless -n option is given.


Options:

-c comment

The new user's password file comment field.

d home_dir

The new user will be created using home_dir as the value for the user's login directory.

-e expire_date

The date on which the user account will be disabled. The date is specified in the format YYYY-MM-DD.

-f inactive_days

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.

-g initial_group

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.

-m

The user's home directory will be created if it does not exist.



Command

usermod

Purpose

Modify a user account

Synopsis

usermod [options] login


Description:

The usermod command modifies the system account files to reflect the changes that are specified on the command line.


Options:

-c comment

The new value of the user's password file comment field. It is normally modified using the chfn(1) utility.

-d home_dir

The user's new login directory.

-e expire_date

The date on which the user account will be disabled. The date is specified in the format YYYY-MM-DD.

-f inactive_days

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 .

-g initial_group

The group name or number of the user's new initial login group. The group name must exist. A group number must refer to an already existing group. The default group number is 1 .

-G group, [...]

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.

-l login_name

The name of the user will be changed from login to login_name . Nothing else is changed. In particular, the user's home directory name should probably be changed to reflect the new login name.

-L

Lock a user's password. This puts a ! in front of the encrypted password, effectively disabling the password. You can't use this option with -p or -U.

-U

Unlock a user's password. This removes the ! in front of the encrypted password. You can't use this option with -p or -L



Command

userdel

Purpose

Delete a user account and related files

Synopsis

userdel [-r] login


Description:

The userdel command modifies the system account files, deleting all entries that refer to login. The named user must exist.



Command

id

Purpose

Print real and effective uid and gid

Synopsis

id [option] ... [username]


Description:

The id command prints information about the given user, or the process running it if no user is specified.

By default, it prints the real user id, real group id, effective user id if different from the real-user id, effective group id if different from the real group id, and supplemental group ids.


Options:

-g

Print only the group id.

-G

Print only the supplementary groups.

-n

Print the user or group name instead of the ID number. Requires ' -u , -g , or -G .

-u

Print only the user id.

-r

Files in the user's home directory will be removed along with the home directory itself. Files located in other file system will have to be searched for and deleted manually.



Command

groupadd

Purpose

Create a new group

Synopsis

groupadd [options] group


Description:

The groupadd command creates a new group account using the values specified on the command line and the default values from the system. The new group will be entered into the system files as needed. The options, which apply, to the groupadd command are -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 500 and greater than every other group. Values between 0 and 499 are typically reserved for system accounts.



Command

groupmod

Purpose

Modify a group

Synopsis

groupmod [options] [-n group_name] group


Description:

The groupmod command modifies the system account files to reflect the changes that are specified on the command line.


Options:

-g grid

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. Values between 0 and 99 are typically reserved for system groups. Any files, which, the old group ID is the file group ID, must have the file group ID changed manually.

-n group_name

The name of the group will be changed from group to group_name.



Command

groupdel

Purpose

Delete a group

Synopsis

groupdel group


Description:

The groupdel command modifies the system account files, deleting all entries that refer to group. The named group must exist. You must manually check all filesystems to insure that no files remain with the named group as the file group ID. You may not remove the primary group of any existing user. You must remove the user before you remove the group.



Command

passwd

Purpose

Update a user's password

Synopsis

passwd [username]



Command

gpasswd

Purpose

Administer the /etc/group file

Synopsis

gpasswd group

gpasswd -a user group

gpasswd -d user group

gpasswd -R group

gpasswd -r group

gpasswd [A user, ...] [-M user, ...] group


Description:

The gpasswd command is used to administer the/etc/group file. Every group can have administrators, members and a password. System administrator can use –A option to define group administrator(s) and -M option to define members and has all rights of group administrators and members. Group administrator can add and delete users using -a and -d options respectively. Administrators can use –r option to remove group password. When no password is set only group members can use newgrp(1) to join the group. Option -R disables access to the group through newgrp(1) command. The gpasswd command called by a group administrator with group name only prompts for the group password. If password is set the members can still newgrp(1) without a password, non-members must supply the password.



Command

finger

Purpose

User information lookup program

Synopsis

finger [-lmsp] [user ...] [user@host ...]


Description:

The finger command displays information about the system users.


Options:

-s

Finger displays the user's login name, real name, terminal name and write status (as a * after the terminal name if write permission is denied), idle time, login time, office location and office phone number.

-l

Produces a multi-line format displaying all of the information described for

the -s option as well as the user's home directory, home phone number, login shell, mail status, and the contents of the files .plan and .project and .forward from the user's home directory.

-p

Prevents the -l option of finger from displaying the contents of the .plan and .project files.

-m

Prevent matching of user names. User is usually a login name; however, matching will also be done on the users' real names, unless the -m option is supplied. All name matching performed by finger is case insensitive


If no options are specified, finger defaults to the -l style output if operands are provided, otherwise to the -s style. Note that some fields may be missing, in either format, if information is not available for them.


If no arguments are specified, finger will print an entry for each user currently logged into the system.



Command

chfn

Purpose

Change your finger information

Synopsis

- -


Description:

The chfn command is used to change your finger information. This information is stored in the /etc/passwd file, and is displayed by the finger program. The Linux finger command will display four pieces of information that can be changed by”

chfn: your real name, your work room and phone, and your home phone.


Command

updatedb

Purpose

Update the slocate database

Synopsis

updatedb


Description:

The updatedb command is just a link to slocate , a security-enhanced version of locate.



Command

chattr

Purpose

Change file attributes on a Linux second extended file system

Synopsis

- -


Description:

When a file with the A attribute set is modified, its atime record is not modified. This avoids a certain amount of disk I/O for laptop systems.


A file with the a attribute set can only be open in append mode for writing. Only the superuser can set or clear this attribute.


A file with the c attribute set is automatically compressed on the disk by the kernel. A read from this file returns uncompressed data. A write to this file compresses data before storing them on the disk.


A file with the d attribute set is not candidate for backup when the dump(8) program is run.


A file with the i attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser can set or clear this attribute.



Command

chpasswd

Purpose

Update password file in batch

Synopsis

- -


Description:

The chpasswd command reads a file of user name and password pairs from standard input and uses this information to update a group of existing users. Without the -e switch, the passwords are expected to be cleartext. With the -e switch, the passwords are expected to be in encrypted form. Each line is of the format:

user_name:password

+/-
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.
+/- Comments
Add New Search RSS

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."