Linux 系统中的 /etc/issue and /etc/issue.net 文件

Linux 系统中的 /etc/issue and /etc/issue.net 文件

1. /etc/issue and /etc/issue.net

(base) yongqiang@yongqiang:~$ cat /etc/issue
Ubuntu 20.04.5 LTS \n \l

(base) yongqiang@yongqiang:~$
(base) yongqiang@yongqiang:~$ cat /etc/issue.net
Ubuntu 20.04.5 LTS
(base) yongqiang@yongqiang:~$
(base) yongqiang@yongqiang:~$ man issue
  • prelogin message and identification 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.
/etc/issue.net 是一个文本文件,它包含了在登录提示符出现之前显示的信息或者系统标识。

The following sequences are supported by telnetd:

%t 
- show the current tty
%h
- show the system node name (FQDN)
%D
- show the name of the NIS domain
%d
- show the current time and date
%s
- show the name of the operating system (操作系统的名称)
%m
- show the machine (hardware) type
%r
- show the operating system release
%v
- show the operating system version (操作系统的版本)
%%
- display a single '%' character

Run the following commands to set permissions on /etc/issue.net:

# chown root:root /etc/issue.net
# chmod u-x,go-wx /etc/issue.net

2. /etc/ssh/sshd_config

取消 /etc/ssh/sshd_config 文件中 Banner /etc/issue.net 的注释,/etc/issue.net 文件才能生效。

/etc/issue.net 只会输出原始字符,不支持转义符号。

(base) yongqiang@yongqiang:~$ cat /etc/ssh/sshd_config
...

# Default banner path
#Banner /etc/issue.net

...
(base) yongqiang@yongqiang:~$

The /etc/issue file is normally used to display a login message or banner.

$ ssh yongqiang@192.168.0.1
 Ubuntu 20.04.5 LTS
 yongqiang@192.168.0.1’s password:
 

References

[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/

相关推荐

最近更新

  1. TCP协议是安全的吗?

    2024-06-14 13:12:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-14 13:12:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-14 13:12:02       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-14 13:12:02       20 阅读

热门阅读

  1. 深入探索Spring Boot的自动配置机制

    2024-06-14 13:12:02       11 阅读
  2. Kafka 如何保证消息顺序及其实现示例

    2024-06-14 13:12:02       8 阅读
  3. Day37

    2024-06-14 13:12:02       5 阅读
  4. 二分查找详解

    2024-06-14 13:12:02       9 阅读
  5. 蓝中面试(一)

    2024-06-14 13:12:02       6 阅读