14 finger

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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • linux资料总章2.1 1.0写的不好抱歉 但是2.0已经改了很多 但是错误还是无法避免 以后资料会慢慢更新 大...
    数据革命阅读 14,269评论 2 33
  • Ubuntu的发音 Ubuntu,源于非洲祖鲁人和科萨人的语言,发作 oo-boon-too 的音。了解发音是有意...
    萤火虫de梦阅读 100,013评论 9 468
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,850评论 19 139
  • win7 cmd管理员权限设置 net localgroup administrators 用户名 /add 把“...
    f675b1a02698阅读 10,757评论 0 11
  • 芭蕉 大牛 随初秋的雨 一同飘落南...
    飞树阅读 2,507评论 0 0

友情链接更多精彩内容