用户功能finger
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用户功能finger相关的知识,希望对你有一定的参考价值。
用户功能
查阅更多的用户相关信息命令:finger
语法: finger [-s] user_name
-s:仅列出用户的账号,全名,终端机代号与登陆时间
-m:列出后面接的账号相同者,而不利用部分对比(包括全名部分)
例子:
[[email protected] ~]# finger xx Login: xx Name: Directory: /home/xx Shell: /bin/bash Never logged in. No mail. No Plan.
新建自己的计划文档:
[[email protected] ~]$ echo "i will have anice day" >~/.plan [[email protected] ~]$ finger xx Login: xx Name: Directory: /home/xx Shell: /bin/bash Never logged in. No mail. Plan: i will have a nice day
单独使用finger命令时,列出目前登陆到系统的所有用户和登陆时间
[[email protected] ~]$ finger Login Name Tty Idle Login Time Office Office Phone whx centos6.9 tty1 1:00 Oct 9 18:18 (:0) whx centos6.9 pts/0 Oct 9 18:19 (192.168.21.1)
修改用户相关信息命令chfn
语法:chfn [-foph] [user_name]
-f:后接完整的全名
-o:后接办公室号码
-p:后接办公室电话号
-h:后接家庭电话号
例子:
[[email protected] ~]$ chfn Changing finger information for xx. Password: Name []: xx for test Office []: guiyang Office Phone []: 11111 Home Phone []: 11111 Finger information changed. [[email protected] ~]$ finger xx Login: xx Name: xx fortest Directory: /home/xx Shell: /bin/bash Office: guiyang, x1-1111 Home Phone: x1-1111 Never logged in. No mail. Plan: i will have a nice day [[email protected] ~]$ grep xx /etc/passwd xx:x:501:501:xx fortest,guiyang,11111,11111:/home/xx:/bin/bash xxx:x:502:502::/home/xxx:/bin/bash
更改shell命令chsh
语法:chsh [-ls]
-s:设置修改自己的shell
-l:列出目前系统上可用的shell
[[email protected] ~]$ chsh -l /bin/sh /bin/bash /sbin/nologin /bin/dash /bin/tcsh /bin/csh [[email protected] ~]$ chsh -s /bin/csh Changing shell for xx. Password: Shell changed. [[email protected] ~]$ grep xx /etc/passwd xx:x:501:501:xx fortest,guiyang,11111,11111:/home/xx:/bin/csh xxx:x:502:502::/home/xxx:/bin/bash [[email protected] ~]$ chsh -s /bin/bash Changing shell for xx. Password: Shell changed. [[email protected] ~]$ ll $(which chsh) -rws--x--x. 1 root root 20056 Mar 22 2017 /usr/bin/chsh [[email protected] ~]$ id xx
查看用户的uid,gid等信息命令id
语法:id [user_name]
不添加用户名时,列出当前用户的信息
例子:
[[email protected] ~]$ id uid=501(xx) gid=501(xx)groups=501(xx),500(whx),503(testgrp) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 [[email protected] ~]$ id whx uid=500(whx) gid=500(whx)groups=500(whx),501(xx),503(testgrp)
本文出自 “天黑顺路” 博客,请务必保留此出处http://mjal01.blog.51cto.com/12140495/1971090
以上是关于用户功能finger的主要内容,如果未能解决你的问题,请参考以下文章