Linux and Windows Interop file user profiles and password profiles user groups/user management

Source: Internet
Author: User

Linux and Windows inter-pass files (provided that you must use Xshell or SECURECRT, you cannot use putty)

Yum install-y lrzsz//linux and Windows cross-transfer files need to be installed on Linux yum Lrzsz

SZ file name//linux file to Windows

RZ Enter, select File//windows to the Linux file, upload to the current directory

Xshell and SECURECRT support;
Putty not supported

Ii. user profile and password configuration file
[Email protected] ~]# CAT/ETC/PASSWD
Root:x:0:0:root:/root:/bin/bash//used: Divided into 7 segments user name: Password: UID: Group ID: User comment information: User home directory: User shell
Bin:x:1:1:bin:/bin:/sbin/nologin
Daemon:x:2:2:daemon:/sbin:/sbin/nologin
Adm:x:3:4:adm:/var/adm:/sbin/nologin

The real password for the Linux system is stored under/etc/shadow, but the password is encrypted.
[Email protected] ~]# Cat/etc/shadow
Root:$6$nlejlezy$kbv252z71egreugmwbxkei9yo3pq9rtpl3.lxsis0qdzwktcguit3yc7cbzjbfdx5lv0.kjwetlrsjadifs4p0 : 17622:0:99999:7::://etc/shadow with/etc/passwd file one by one below
Bin::17110:0:99999:7::://use: Split into 9 segments User name: User password: Last change password distance January 1, 1970 How many days: how many days will it take to change the password: How long before the password expires: How many days before password expiration warning: How many days the password has expired however, you have not changed the password, this password will be locked: The life cycle of an account: Reserved fields
Daemon
:: 17110:0:99999:7:::
Adm:*:17110:0:99999:7:::

[Email protected] ~]# Head-n1/etc/shadow; Tail-n2/etc/shadow
Also displays the first and last two lines of a file in the command format: head-n1 file path; TAIL-N2 file path

Third, user group management
[Email protected] ~]# Ls/etc/shadow
Shadow shadow-//with a minus sign file is the system to help us automatically back up a copy, such as not mind delete user files, you can copy a minus the same file to use
[Email protected] ~]# Ls/etc/gshadow
Gshadow gshadow-
[Email protected] ~]# LS/ETC/PASSWD
passwd passwd-
[Email protected] ~]# Ls/etc/group
Group group-

Add Group
[[email protected] ~]# Groupadd GRP1//Add GRP1 Group
[[email protected] ~]# Tail-n1/etc/group//View the last line of the group file
GRP1:X:1003:
[[email protected] ~]# GROUPADD-G 1005 grp2//Add and specify GRP2 Group ID 1005
[[email protected] ~]# Tail-n3/etc/group//View the last three lines of the group file
SLOCATE:X:21:
GRP1:X:1003:
GRP2:X:1005:

Delete a group
[[email protected] ~]# Groupdel GRP1//delete GRP1 Group
Note: An empty group can be deleted, and there are users below the group that cannot be deleted

Iv. User Management
Add user
[[email protected] ~]# Useradd user3//Add User3 User
[Email protected]-01 ~]# tail-n2/etc/passwd
Hll:x:1001:1002::/home/hll:/bin/bash
User3:x:1002:1006::/home/user3:/bin/bash

Add and specify UID and group
[[email protected] ~]# useradd-u 1004-g grp2 user4//Add USER4 user and specify UID 1004, add to GRP2 Group
[Email protected] ~]# TAIL-N3/ETC/PASSWD
Hll:x:1001:1002::/home/hll:/bin/bash
User3:x:1002:1006::/home/user3:/bin/bash
User4:x:1004:1005::/home/user4:/bin/bash

Add users and specify home directories
[Email protected] ~]# useradd-u 1010-g grp2-d/home/user3-s/sbin/nologin User6

-M option: Add user but do not create user home directory
[[email protected] ~]# useradd-m user7//Add User7 User but do not create its home directory

Delete User
[[email protected] ~]# Userdel user3//delete user3 user, but do not delete user's home directory

-R option: Delete User's home directory while deleting users
[Email protected] ~]# Userdel-r user4
[Email protected] ~]# Ls/home
HLL user1 User3

Linux and Windows Interop file user profiles and password profiles user groups/user management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.