linux登录前提示与登录后提示配置文件
1)cat /etc/issue
登录前提示 添加登录时间,当前终端,主机名 nano /etc/issue hostname:\n tty:\l time:\t
- [root@centos7:/etc ]# cat /etc/issue
- hostname:\n
- tty:\l
- time:\t
- \S
- Kernel \r on an \m
[root@centos7:~ ]# man issue
ISSUE(5) Linux Programmer's Manual ISSUE(5)
NAME
issue - prelogin message and identification file
DESCRIPTION
The file /etc/issue is a text file which contains a message or system identification to be printed before the login prompt. It may contain various @char and \char sequences,
if supported by the getty-type program employed on the system.
FILES
/etc/issue
SEE ALSO
motd(5), agetty(8), mingetty(8)
COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at
http://www.kernel.org/doc/man-pages/.
Linux 1993-07-24 ISSUE(5)
Manual page issue(5) line 1/24 (END) (press h for help or q to quit)
[root@centos7:~ ]# man 8 agetty
AGETTY(8) System Administration AGETTY(8)
NAME
agetty - alternative Linux getty
SYNOPSIS
agetty [options] port [baud_rate...] [term]
DESCRIPTION
agetty opens a tty port, prompts for a login name and invokes the /bin/login command. It is normally invoked by init(8).
……
Example: On my system, the following /etc/issue file:
This is \n.\o (\s \m \r) \t
displays as
This is thingol.orcan.dk (Linux i386 1.1.9) 18:29:30
FILES
/var/run/utmp
the system status file.
/etc/issue
printed before the login prompt.
/etc/os-release
Manual page agetty(8) line 218 (press h for help or q to quit)
2)/etc/gdm/custom.conf 配置自动登录
(可省略登录用户名和密码)修改启动选项,可自动登录。在daemon下面添加AutomaticLoginEnable=true AutomaticLogin=root
3) /etc/motd开机登录后启动提示
rz cat /etc/motd secureCRT查看windows文件并加入 motd文件为开机登录后启动提示。motd文件可以随意设置图形等。如下图的示例:
[root@centos7test:~ ]# cat /etc/motd
*
***
*****
*******
[root@centos7test:~ ]#
Last login: Thu Jun 21 20:35:22 2018 from 172.18.118.99
*
***
*****
*******
[root@centos7test:~ ]#
*
***
*****
*******
4)图形界面登录时,会显示用户列表,可以不让其显示用户列表
[root@client6 ~ ]#vim /etc/gconf/gconf.xml.defaults/%gconf-tree.xml
21164,27-62 51%
<entry name="disable_user_list" mtime="1526381377" type="schema" st
ype="bool" owner="gdm-simple-greeter" gettext_domain="gdm">
<local_schema locale="C" short_desc="Do not show known user
s in the login window">
<default type="bool" value="false"/> #图形界面登录时不显示用户列表
<longdesc>Set to true to disable showing known user
s in the login window.</longdesc>
</local_schema>