命令linux用户管理命令(添加,删除,修改)(Linux user management commands (add, delete, modify))

linux删除命令  时间:2021-02-27  阅读:()

linux用户管理命令(添加,删除,修改) Linux user managementcommands (add, del et e, modi fy) 

Linux forced landing users kicked off

View users landing in machines

[root@sunsyk w~]#

16:29:02 up 2 days, 2:35, 5 users, load average: 0.03, 0.05,

0.01

USER, TTY, FROM, LOGIN@, IDLE, JCPU, PCPU, WHAT

Root pts/1 : 0, Tue15, 2days, 1:44, 0.04s, -bash

Root pts/2: 0, Tue15, 46:42m, 0.05s, 0.05s, Bash

Root pts/3: 0, Tue15, 2days, 0.02s, 0.02s, Bash

Root, pts/4, 172.20.52. 114, 14: 17, 58:48, 0. 16s, 0.03s,sqlplus

Root, pts/5, 172.20.52. 114, 15:31, 0.00s, 0.03s, 0.00s, wI put the pts/1 out (only root to kick off the user)[root@sunsyk pkill -kill -t pts/1 ~]#

[root@sunsyk pkill -kill -t pts/2 ~]#

[root@sunsyk pkill -kill -t pts/3 ~]#

See is not kicked off

[root@sunsyk w~]#

16:34:16 up 2 days, 2:40, 2 users, load average: 0, 0.05, 0.02USER, TTY, FROM, LOGIN@, IDLE, JCPU, PCPU, WHAT

Root, pts/4, 172.20.52. 114, 14: 17, 1 :04m, 0. 16s, 0.03s,sqlplus

Root, pts/5, 172.20.52. 114, 15:31, 0.00s, 0.03s, 0.00s, wLog in as the login command:

During the user login system, you can also change the identitywith the "login" command and even log on to other hosts inaddition to the "Su-" command. If you use the "login" commandto change the identity, as long as the input will change theusername directly in the command: [root@ns1 root]# loginCaroline - > change user name is Caroline, if you want to logon the other host, need to use the "-h"parameter to the "login"command: [root@ns1 root]# login-h linux2 - >Linux2 login forthe host.

Log in as the rlogin command:

Inaddition to using the login command, rlogin can alsobe usedto log on to remote hosts, and its usage is simple. Here is an

example of a connection to linux2. jschouse.com:

[root@ns1 root]# rlogin linux2. jschouse.com - >linux2. jschouse. com login

Password: is in the same name - > * login default, so there isno "login" informat ion

Login incorrect- > if the name used to login with the username,can directly press the "Enter", and ignore the errori nformat ion

Login: Jack - > to enter a different username

Password: * - > password

The use of /etc/nologin files:

If you want to only root can log on the host, other account cannot log in, you can add a file named "nologin" in the /etcdirectory in the file, as long as the random input characterscan be found in the file system as long as there will preventother users login.

System logout:

The front is introduced to change the identity in the "login"command, and can log on the other host, and login relative tothe command "logout", it can make the currently logged on userlog off the system, so that other users login. The use of thiscommand is simple. You can log on to the system as long as you

enter "logout": [root@ns1 root]# logout

As described earlier, the Linux system is a multi-useroperating system, and each user' s access to the system needsto be set by the system administrator. This section describessome of the commands that the system administrator manages forusers and user groups.

4.6. 1 creates new users

The useradd command (also using addUser) is used to create anew user account with the following commands:

Table 4 - 19 useradd command common options

Common phenomenon

Significance

-d

Sets the landing directory for new users

-e

Set the new user' s stop date, the date format is MM/DD/YY-f

A few days after the account has expired permanent suspension.The value is 0 when the account is immediately stopped. When

duty is -1, this function is turned off. The default value is-1

-g

Enable new users to join groups

-G

Add new users to a new group. Each group is separated by commas,which must not be enclosed in blank words

-s

Specifies the login Shell for the new user

-u

Sets the ID value for new users

When a new user is created successfully, a line of informationabout that user is added to the /etc/passwd file, formatted asfollows:

[user name: [password] : [UID] : [GID] : [identity description] :[home directory] [landing Shell]

One of the fields is divided into 7 parts by the colon ":".Because less than 500 of the UID and GID are generally the systemitself retained, do not do ordinary users and groups of signs,

so the new increase in users and groups are generally UID andGID greater than 500.

For example, use the following command:

Root@localhost root useradd user1 #

A user named userl will be created, and the user managementcommand has been introduced, and no more is introduced here.The result of executing the useradd command is shown in figure11-13.

4.6.2 sets and modifies user password passwd

The passwd command is used to set and modify user commands. Onlysuper users and users can change their passwords themselves,and other ordinary users do not have the right to modify otheruser passwords. Its order is as follows:

# passwd username.

To avoid entering passwords, it is noticed howmany bits, Linuxdoes not use a password like Windows echo [shown as *] , so theinput of these characters is invisible. For example, to setpasswords for new userl users, use the following command:Root@localhost root passwd user1 #

According to the system prompted information, enter thepassword two times, the system will display:

Passwd: : all, authentication, tokens, updated, successfullyIndicates that the change password succeeded. The new user' sjob is completed only after the user has set the password,otherwise the user name cannot be used to log on.

4.6. 3 modify user information usermod

The usermod command is used to modify user information, and itscommand format is as follows:

# usermod option: user name.

The common command option, 11-20, is shown.

Table 4-20 common options for usermod commands

Common options

Significance

-d

Update the user' s new login directory

-e

Set the new user' s stop date, the date format is MM/DD/YY-f

A few days after the account has expired permanent suspension.The value is 0 when the account is immediately stopped. Whenduty is -1, this function is turned off. The default value is-1

-g

Update user new user to join group

-G

Define the user as a group of groups members. Each group uses"?"" Separate from blank words

-l

To change the name of the user login, the user at the same timethe directory name will follow the change into a new name-s

Specify a new user Shell

-u

The user ID value must be the unique ID value. The user directorytree document directory the userID will automatically changeon the support directory document is to manually changeFor example, the following command modif ies user information:

Root@localhost root usermod- d/home/user2 s/bin/bash user2 -#

Set the home directory path for user name user2 at/home/user1,and the Shell setting for login to /usr/bin/gcc.

In general, the usermod command modifies user accountinformation with reference to the commands section. However,usermod does not allow changing the user account name on theline, so when using usermod to change user account information,You must verify that this name has not been executed on thec omputer.

4.6.4 new group groupadd

The groupadd command is used to create a new group of users,and the commands are as follows:

# groupadd options: user name.

Common options are:

-g:GID value. Unless the -o parameter is used, the value mustbe unique, not the same, and the value must not be negative.The GID value is preset to be minimum, not less than 500 andincreased sequentially. 0 - 499 is traditionally reserved forsystem account usage.

牦牛云(3.5USD/月 )阿里云国际版云服务器 1核1G40G

收到好多消息,让我聊一下阿里云国际版本,作为一个阿里云死忠粉,之前用的服务器都是阿里云国内版的VPS主机,对于现在火热的阿里云国际版,这段时间了解了下,觉得还是有很多部分可以聊的,毕竟,实名制的服务器规则导致国际版无需实名这一特点被无限放大。以前也写过几篇综合性的阿里云国际版vps的分析,其中有一点得到很多人的认同,那句是阿里云不管国内版还是国际版的IO读写速度实在不敢恭维,相对意义上的,如果在这...

瓜云互联-美国洛杉矶高防CN2高防云服务器,新老用户均可9折促销!低至32.4元/月!

瓜云互联一直主打超高性价比的海外vps产品,主要以美国cn2、香港cn2线路为主,100M以内高宽带,非常适合个人使用、企业等等!安全防护体系 弹性灵活,能为提供简单、 高效、智能、快速、低成本的云防护,帮助个人、企业从实现网络攻击防御,同时也承诺产品24H支持退换,不喜欢可以找客服退现,诚信自由交易!官方网站:点击访问瓜云互联官网活动方案:打折优惠策略:新老用户购买服务器统统9折优惠预存返款活动...

华纳云新人下单立减40元/香港云服务器月付60元起,香港双向CN2(GIA)

华纳云(HNCloud Limited)是一家专业的全球数据中心基础服务提供商,总部在香港,隶属于香港联合通讯国际有限公司,拥有香港政府颁发的商业登记证明,保证用户的安全性和合规性。 华纳云是APNIC 和 ARIN 会员单位。主要提供数据中心基础服务、互联网业务解决方案, 以及香港服务器租用、香港服务器托管、香港云服务器、美国云服务器,云计算、云安全技术研发等产品和服务。其中云服务器基于成熟的 ...

linux删除命令为你推荐
郭吉军二战中受害最大的国家?真正免费的网络电话有没有真正免费的网络电话?而且是好用的?缓冲区溢出教程如何防止高手使用缓冲区溢出?flash导航条如何添加FLASH导航条godaddygodaddy域名怎样使用mate8价格华为mate8 128g售价多少钱虚拟机软件下载谁有虚拟机软件的网址要好用的如何清理ie缓存怎么清理IE的缓存微信电话本怎么用微信电话本怎么使用呀,我的电话号码是存在手机里面,用这个软件就读取不了电话,我是第一次使用freebsd安装虚拟机vmware7的安装和FreeBSD的安装
免费国际域名 cn域名备案 免费申请域名和空间 冰山互联 ion godaddy主机 la域名 512au xfce 免费smtp服务器 蜗牛魔方 anylink 免费吧 国外代理服务器地址 smtp服务器地址 畅行云 lamp架构 supercache 优惠服务器 建站论坛 更多