Linux and Windows Interop files, user profiles and password profiles, user groups and user management

Source: Internet
Author: User

    • Linux and Windows inter-pass files

    • User profile and password configuration files

    • User Group Management

    • User Management

2.27 Linux and Windows interop files want to enable Linux and Windows to pass files, you can use Xshell, but first you need to install a package in Linux, the command is as follows:
[email protected] ~]# Yum install-y lrzsz
After the installation, you can use the command to upload Linux files to Windows, for example, I want to upload the A.txt file to Windows, the command is as follows:
[Email protected] ~]# sz A.txt

Then it will pop up an interface that allows you to select the saved path and save it as you want.

You can also upload Windows files to Linux with the following commands:
[Email protected] ~]# RZ

The same will pop up an interface for you to choose the files that need to be passed to Linux, the path to save the file is your Linux current input this command path

Note: This tool only applies to Xshell and Securecrt,putty is not supported for 3.1 user profiles and password profiles in the ETC directory under the passwd file is the core of the user profile, each creation of a user's information will be stored in this file, The structure of this file is one row per user, and each row is split into seven segments. The first paragraph represents the user name, the second paragraph is the password placeholder (so the password is not stored in this file), the third paragraph is the user's UID, the fourth paragraph is the user belongs to the group of GID, the fifth paragraph is the user's description, comments information, the sixth paragraph is the user's home directory is also called the host directory, the seventh section
[[email protected] ~]# cat /etc/passwdroot:x:0:0:root:/root:/bin/bash      //the first line is the root user, down is the system comes with the Bin:x:1:1:bin:/bin:/sbin/nologindaemon:x:2:2:daemon:/sbin:/sbin/nologinadm : x:3:4:adm:/var/adm:/sbin/nologinlp:x:4:7:lp:/var/spool/lpd:/sbin/nologinsync:x:5:0:sync:/sbin:/bin/ syncshutdown:x:6:0:shutdown:/sbin:/sbin/shutdownhalt:x:7:0:halt:/sbin:/sbin/haltmail:x:8:12:mail:/var/spool/ Mail:/sbin/nologinoperator:x:11:0:operator:/root:/sbin/nologingames:x:12:100:games:/usr/games:/sbin/nologinftp : x:14:50:ftp user:/var/ftp:/sbin/nologinnobody:x:99:99:nobody:/:/sbin/nologinavahi-autoipd:x:170:170: Avahi ipv4ll stack:/var/lib/avahi-autoipd:/sbin/nologinsystemd-bus-proxy:x:999:997:systemd bus  proxy:/:/sbin/nologinsystemd-network:x:998:996:systemd network management:/:/sbin/nologindbus: x:81:81:system message bus:/:/sbin/nologinpolkitd:x:997:995:user for polkitd:/:/sbin/ Nologintss:x:59:59:account used by the trousers package to sandbox the tcsd daemon:/dev/null:/ sbin/nologinpostfix:x:89:89::/var/spool/postfix:/sbin/nologinsshd:x:74:74:privilege-separated ssh:/var/ empty/sshd:/sbin/nologinzero:x:1000:1000::/home/zero:/bin/bash   //starting from here is the creation of the ordinary user user1:x : 1001:1001::/home/user1:/bin/bash

In this file can be found that the root user and the general user's seventh message is/bin/bash, which means that these users can log on, and the system comes with a majority of users are sbin/nologin, which means that these users can not log on.

Relative in the ETC directory there is also a shadow file, this file is the user's password file, the user's password is stored here, this file and the passwd file is one by one corresponding, so this file is specifically used to store, control the user's password. The same file is each line of records of a user, separated by a colon into nine paragraphs, the first paragraph is the user's name, the second paragraph is the user's password, these passwords are encrypted, because the use of MD5 algorithm plus random number generated ciphertext so can not be cracked or decompile; The third paragraph is a number of days, This number of days is calculated from January 1, 1970 to the last time you changed the password, the fourth paragraph indicates how many days to change the password, the default is zero, that is, there is no limit, the fifth paragraph indicates the number of days after the password expires, that is, the number of days must change the password, the sixth paragraph indicates the password expires before the warning, The user's password will be reminded of the expiration of the number of days, the seventh paragraph represents the expiration period of the account, the eighth paragraph represents the life cycle of the account, and the nineth paragraph is a reserved field, with no practical significance.
[Email protected] ~]# cat/etc/shadowroot:$6$uasdxv2a$m4rua7nozjcntcwnscivygc9gxlis1sol/ Kyttewqptupfqf6z9vi8rjayo77r665vwl2zmx03/omwk/ciasm1:17368:0:99999:7:::bin:*:16659:0:99999:7:::d aemon:* : 16659:0:99999:7:::adm:*:16659:0:99999:7:::lp:*:16659:0:99999:7:::sync:*:16659:0:99999:7:::shutdown:* : 16659:0:99999:7:::halt:*:16659:0:99999:7:::mail:*:16659:0:99999:7:::operator:*:16659:0:99999:7:::games:* : 16659:0:99999:7:::ftp:*:16659:0:99999:7:::nobody:*:16659:0:99999:7:::avahi-autoipd:!! : 17351::::::systemd-bus-proxy:!! : 17351::::::systemd-network:!! : 17351,:::::d bus:!! : 17351,:::::p olkitd:!! : 17351::::::tss:!! : 17351,:::::p ostfix:!! : 17351::::::sshd:!! : 17351::::::zero:!! : 17369:0:99999:7:::user1:$6$ld3j2xrc$ 9hvwsrcl7xysetfasohmrns44d7gn7yckzmuwvczdpiwg4km.o29295iuwn0sob6hgpaewqulyhes93mplf6z/:17373:0:99999:7:::
3.2 User group management in the ETC directory there is a group file that stores information about the user group. It's almost like passwd.
[[Email protected] ~]# cat /etc/grouproot:x:0:bin:x:1:daemon:x:2:sys:x:3:adm:x:4:tty:x:5: DISK:X:6:LP:X:7:MEM:X:8:KMEM:X:9:WHEEL:X:10:CDROM:X:11:MAIL:X:12:POSTFIXMAN:X:15:DIALOUT:X:18:FLOPPY:X:19: Games:x:20:tape:x:30:video:x:39:ftp:x:50:lock:x:54:audio:x:63:nobody:x:99:users:x:100:avahi-autoipd:x:170:utmp : x:22:utempter:x:35:ssh_keys:x:999:input:x:998:systemd-journal:x:190:systemd-bus-proxy:x:997:systemd-network:x : 996:dbus:x:81:polkitd:x:995:dip:x:40:tss:x:59:postdrop:x:90:postfix:x:89:sshd:x:74:zero:x:1000:user1:x:1001: slocate:x:21:[[email protected] ~]# [[email protected] ~]# cat /etc/ Grouproot:x:0:bin:x:1:daemon:x:2:sys:x:3:adm:x:4:tty:x:5:disk:x:6:lp:x:7:mem:x:8:kmem:x:9:wheel:x:10:cdrom:x : 11:mail:x:12:postfixman:x:15:dialout:x:18:floppy:x:19:games:x:20:tape:x:30:video:x:39:ftp:x:50:lock:x:54: audio:x:63:nobody:x:99:users:x:100:avahi-autoipd:x:170:utmp:x:22:utempter:x:35:ssh_keys:x:999:input:x:998: Systemd-journal:x:190:systemd-bus-proxy:x:997:systemd-network:x:996:dbus:x:81:polkitd:x:995:dip:x:40:tss:x:59:postdrop:x:90:postfix:x:89:sshd:x : 74:zero:x:1000:user1:x:1001:slocate:x:21:
In addition to the ETC directory there is a file similar to shadow: Gshadow, this file is the user group password configuration file, this file will almost not move it.
[Email protected] ~]# Cat/etc/gshadowroot:::bin:::d aemon:::sys:::adm:::tty:::d isk:::lp:::mem:::kmem:::wheel::: Cdrom:::mail:::p ostfixman:::d ialout:::floppy:::games:::tape:::video:::ftp:::lock:::audio:::nobody:::users.::: avahi-autoipd:!::utmp:!::utempter:!::ssh_keys:!::input:!::systemd-journal:!::systemd-bus-proxy:!:: systemd-network:!::d bus:!::p olkitd:!::d ip:!::tss:!::p ostdrop:!::p ostfix:!::sshd:!::zero:!::user1:!::slocate:!: :
If you use the LS command to list the files individually, you will find a file with the same name with a-number, the file with the number is a backup file, if you accidentally deleted the original file, copy this file can be used. However, there may be a problem, if you just create a new user, but this backup file has not yet been updated, the user's information will be lost, but generally less impact.

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/3c5b2cbbf1e4d8ce0a64906243e9884f/xmlnote/ 9e83a222d20a4c9383e756c2852d2658/1154 "alt=" image "Style=" Border-style:none;background-color:rgb (255,255,255); "/ >

About user groups There is a command: Groupadd, which is used to add user groups, example:
[Email protected] ~]# groupadd grp1[[email protected] ~]# tail-n1/etc/groupgrp1:x:1002:
Created at the same time can specify the GID, the CentOS7 specified in the GI to more than 1000, 1000 or less has been reserved for the system, CENTOS6 is more than 500, this point to distinguish:
[Email protected] ~]# groupadd-g 1005 grp2[[email protected] ~]# tail-n2/etc/groupgrp1:x:1002:grp2:x:1005:
Now that you can create a user group, you can delete the user group, but only if there are no users in the user group to delete it, or the command is:
[Email protected] ~]# Groupdel grp1[[email protected] ~]# tail-n1/etc/groupgrp2:x:1005:
Summary: The user group can contain many members, each member is a user, as long as there is a user in this user group, you can not delete this user group. 3.3 User Management Useradd and AddUser commands can add a normal user, the two commands are used the same way, example:
[[email protected] ~]# useradd user2[[email protected] ~]# tail -n3  /etc/passwdzero:x:1000:1000::/home/zero:/bin/bashuser1:x:1001:1001::/home/user1:/bin/bashuser2:x : 1002:1002::/home/user2:/bin/bash 

It can be seen that the UID of the average user starts at 1000.

The same can be used to create users, you can also delete users:
[Email protected] ~]# Userdel user3[[email protected] ~]# tail-n3/etc/passwduser2:x:1002:1002::/home/user2:/bin/ Bashuser4:x:1008:1005::/home/zero000:/sbin/nologinuser5:x:1009:1009::/home/user5:/bin/bash
However, although the user is deleted, but the user's home directory is not deleted, because the user's home may have files, so there is no deletion, left to the system administrator to manually delete:
[Email protected] ~]# ls/home/user1 user2 User3 Zero zero000
You can also delete users ' home directories at the same time by deleting them:
[Email protected] ~]# userdel-r user4[[email protected] ~]# tail-n3/etc/passwduser1:x:1001:1001::/home/user1:/bin/ Bashuser2:x:1002:1002::/home/user2:/bin/bashuser5:x:1009:1009::/home/user5:/bin/bash[[email protected] ~]# ls/ Home/user1 User2 User3 Zero
You can specify the UID of the user, and the user group for the specified user, as an example:
[Email protected] ~]# useradd-u 1006-g grp2 user3[[email protected] ~]# tail-n3/etc/passwduser1:x:1001:1001::/home/us Er1:/bin/bashuser2:x:1002:1002::/home/user2:/bin/bashuser3:x:1006:1005::/home/user3:/bin/bash
You can specify the user's home directory while creating the user, and the shell of the specified user, example:
[Email protected] ~]# useradd-u 1008-g grp2-d/home/zero000-s/sbin/nologin user4[[email protected] ~]# Tail-n3/et c/passwduser2:x:1002:1002::/home/user2:/bin/bashuser3:x:1006:1005::/home/user3:/bin/bashuser4:x:1008:1005::/ Home/zero000:/sbin/nologin
You can also specify that you do not create a user's home directory while creating a user, for example:
[[email protected] ~]# useradd -m  user5[[email protected] ~]#  tail -n3 /etc/passwduser3:x:1006:1005::/home/user3:/bin/bashuser4:x:1008:1005::/home/zero000:/sbin/ nologinuser5:x:1009:1009::/home/user5:/bin/bash[[email protected] ~]# ls /home/user1   user2  user3  zero  zero000   //does not user5 this directory 

Although you specify not to create a home directory, it does not mean that the user does not have a home directory, but is not created.

When creating a user without specifying the UID of the user, the default is to increment the UID from the previous user. If the GID is not specified when the user is created, the GID does not increment according to the previous user's GID, but is consistent with the user's UID.


This article is from the "12831981" blog, please be sure to keep this source http://12841981.blog.51cto.com/12831981/1972137

Linux and Windows Interop files, user profiles and password profiles, user groups and user management

Related Article

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.