zoukankan      html  css  js  c++  java
  • /etc/issue、/etc/issue.net和/etc/motd的区别

    2020-02-26

    /etc/issue 和 /etc/issue.net 两个文件是在登录之前显示的。前者在本地登录前显示,后者在网络登录前显示。当在TTY控制台登录前 /etc/issue 会被显示, Telnet 登录前则显示 /etc/issue.net。而SSH两者均不显示。/etc/motd 则在成功登陆终端后立即显示。

    • man pages 中的描述

    man issue

    ISSUE(5) Linux Programmer's Manual

    NAME

    issue - prelogin message and identification file

    DESCRIPTION

    /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

    man motd

    MOTD(5) Linux Programmer's Manual

    NAME

    motd - message of the day

    DESCRIPTION

    The contents of /etc/motd are displayed by login(1) after a successful login but just before it executes the login shell. The abbreviation "motd" stands for "message of the day", and this file has been traditionally used for exactly that (it requires much less disk space than mail to all users).

    FILES

    /etc/motd

    • 实际测试

    查看文件的实际内容,Fedora28 中 /etc/issue 和 /etc/issue.net 中的内容是一样的:

    S
    Kernel 
     on an m (l)
    

    在后面分别加上它们的文件名。

    而 /etc/motd 默认为空,修改其为:

    /etc/motd
    

    切换到 tty2 并登陆:

    Fedora 28 (Twenty Eight)
    Kernel 5.4.6-1.fc28.lemote.mips64el on an mips64 (tty2)
    /etc/issue
    
    localhost login:***
    Password:
    Last login: Wed Feb ...
    
    /etc/motd
    [***@localhost ~]$
    

    /etc/motd 可以根据需要修改,作为提示信息等。

    • 常用的转义字符

    d 本地端时间的日期

    l 显示 tty 号码

    m 显示硬件等级

    显示主机的网络名称

    o 显示 domain name

    操作系统版本(uname -r)

    显示本地端时间的时间(localtime)

    s 操作系统的名称(Linux)

    S 操作系统信息

    v 操作系统版本

    by SDUST weilinfox
    本文地址:https://www.cnblogs.com/weilinfox/p/12545452.html

  • 相关阅读:
    对html与body的一些研究与理解
    关于文字内容溢出用点点点(...)省略号表示
    CSS3中border-image属性详解
    从TCP协议的原理来谈谈rst复位攻击
    关于Oracle中sysoper这个系统权限的问题
    翻翻git之---有用的欢迎页开源库 AppIntro
    椒盐噪声
    Codeforces Beta Round #1 A. Theatre Square
    log4j:WARN Please initialize the log4j system properly解决的方法
    微信平台开发——日历服务
  • 原文地址:https://www.cnblogs.com/weilinfox/p/12545452.html
Copyright © 2011-2022 走看看