Ubuntu login信息的背后
2013-07-07 21:08
155 查看
当以非图形方式登录入Ubuntu系统时,总会有一些信息,比如软件包升级情况,显示在屏幕上,比如:
它们是怎么被显示出来的呢?经过调查,我查明背后使用的机制pam。
首先在/etc/pam.d/sshd中有:
……
# Print the message of the day upon successful login.
session optional pam_motd.so
# [1]
……
pam_motd.so会显示/etc/motd中内容,/etc/motd的内容为:
实际上/etc/motd是每次登录时由脚本生成的,它是一个符号链接,指向/var/run/motd文件。
生成它的是/etc/update-motd.d下的一系列文件:
update-motd是Ubuntu引入的一种机制,运行"man update-motd"可以得到更多信息。
到此,大部分清楚了,还有一个小尾巴,就是这一行:
本文给出的例子是用ssh登录的,这一行是由sshd的配置文件/etc/ssh/sshd_config决定的,具体地说是这一行
The authenticity of host 'localhost (::1)' can't be established. RSA key fingerprint is c7:25:b4:11:55:95:c5:c2:80:ef:22:f2:9e:5a:95:cf. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'localhost' (RSA) to the list of known hosts. zhi@localhost's password: Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-37-generic x86_64) * Documentation: https://help.ubuntu.com/ 0 packages can be updated. 0 updates are security updates. *** /dev/sda1 will be checked for errors at next reboot *** Last login: Fri Nov 30 20:32:09 2012 zhi@ubuntu-desktop:~$
它们是怎么被显示出来的呢?经过调查,我查明背后使用的机制pam。
首先在/etc/pam.d/sshd中有:
……
# Print the message of the day upon successful login.
session optional pam_motd.so
# [1]
……
pam_motd.so会显示/etc/motd中内容,/etc/motd的内容为:
Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-37-generic x86_64) * Documentation: https://help.ubuntu.com/ 0 packages can be updated. 0 updates are security updates. *** /dev/sda1 will be checked for errors at next reboot ***
实际上/etc/motd是每次登录时由脚本生成的,它是一个符号链接,指向/var/run/motd文件。
生成它的是/etc/update-motd.d下的一系列文件:
/etc/update-motd.d /etc/update-motd.d/00-header /etc/update-motd.d/10-help-text /etc/update-motd.d/90-updates-available /etc/update-motd.d/91-release-upgrade /etc/update-motd.d/98-fsck-at-reboot /etc/update-motd.d/98-reboot-required /etc/update-motd.d/99-footer
update-motd是Ubuntu引入的一种机制,运行"man update-motd"可以得到更多信息。
到此,大部分清楚了,还有一个小尾巴,就是这一行:
Last login: Fri Nov 30 20:32:09 2012
本文给出的例子是用ssh登录的,这一行是由sshd的配置文件/etc/ssh/sshd_config决定的,具体地说是这一行
PrintLastLog yes
相关文章推荐
- 网站背后的信息架构
- 大数据简析“林丹出轨事件”背后的微博信息传播
- 网易你收集用户身份证扫描件意欲何为——隄防维权背后的个人信息安全陷阱
- ASP.NET MVC异步验证是如何工作的01,jQuery的验证方式、错误信息提示、validate方法的背后
- 转贴:Google Reader:信息背后的信息,无可替代的伟大
- 【御姐系列】如何恢复模糊处理过的照片背后的真实信息
- 网络设备的背后黑手——RADIUS信息泄露漏洞
- 野鸡大学背后的信息泄露:千元买3万考生信息
- (转)58同城上市背后:分类信息网站集体转型艰难
- 【转】SNS背后的科学(4)—— 信息的传播
- 如何快速解剖数据背后隐藏的信息
- 扫码送礼品的 黑暗背后,获取个人信息,可以使用
- 大数据简析“林丹出轨事件”背后的微博信息传播
- 京东发布靓丽财报,背后透露什么信息?
- 杀毒软件背后的黑幕——中国最严重的信息安全问题
- 大数据简析“林丹出轨事件”背后的微博信息传播
- 第七次广州软件测试交流会信息公布
- 彻底删除项目的VSS源代码管理信息
- 导出SQL server2005表字段信息说明
- C#提取照片的Exif信息显示在照片上