finger
Linux finger命令的功能是查询用户的信息,通常会显示系统中某个用户的用户名、主目录、停滞时间、登录时间、登录shell等信息。如果要查询远程机上的用户信息,需要在用户名后面接“@主机名”,采用[用户名@主机名]的格式,不过要查询的网络主机需要运行finger守护进程。
在我们的实验环境中,finger是需要安装的。
root@ubuntu:~# finger newer
The program 'finger' is currently not installed. You can install it by typing:
apt-get install finger
安装的命令是:
sudo apt-get install finger
直接输入finger ,查看当前登录用户
root@ubuntu:~# finger
Login Name Tty Idle Login Time Office Office Phone
newer newer *tty2 38 Sep 24 08:46
newer newer *:0 Sep 24 08:45 (:0)
newer newer *pts/0 Sep 24 08:47 (192.168.125.1)
查看具体某个用户
root@ubuntu:~# finger -l newer
Login: newer Name: newer
Directory: /home/newer Shell: /bin/bash
On since Sat Sep 24 08:46 (PDT) on tty2 41 minutes 38 seconds idle
(messages off)
On since Sat Sep 24 08:45 (PDT) on :0 from :0 (messages off)
On since Sat Sep 24 08:47 (PDT) on pts/0 from 192.168.125.1
2 seconds idle
(messages off)
No mail.
No Plan.
修改用户的finger, 使用chfn命令。
root@ubuntu:~# chfn -h
chfn: option requires an argument -- 'h'
Usage: chfn [options] [LOGIN]
Options:
-f, --full-name FULL_NAME change user's full name
-h, --home-phone HOME_PHONE change user's home phone number
-o, --other OTHER_INFO change user's other GECOS information
-r, --room ROOM_NUMBER change user's room number
-R, --root CHROOT_DIR directory to chroot into
-u, --help display this help message and exit
-w, --work-phone WORK_PHONE change user's office phone number