标签: motd

如何在unix中显示欢迎消息?

每次登录unix时如何显示欢迎信息“welcome panni”?

linux login motd

28
推荐指数
5
解决办法
21万
查看次数

Bash .hushlogin,保留上次登录时间和主机

在我的公司,当我登录某些服务器时,会显示我上次登录和一个巨大的横幅:

me@my-laptop$ ssh the-server
Last login: Mon Feb  8 18:54:36 2016 from my-laptop.company.com 
************************************************************************
*                                                                      *
*       C O M P A N Y    I N F O R M A T I O N   S Y S T E M S         *
*                                                                      *
* !WARNING!         Your connection has been logged          !WARNING! *
*                                                                      *
* This system is for the use of authorized personnel only.             *
* Individuals using this *computer system without authorization,       *
* or in …
Run Code Online (Sandbox Code Playgroud)

bash login motd

26
推荐指数
3
解决办法
2万
查看次数

如何在 MOTD 中使用颜色?

我编辑了 default/etc/update-motd.d/00-header,添加了一些颜色以使其更易于阅读:

printf "Welcome to \e[1;34m%s\e[0m \e[2m(%s %s %s)\e[0m\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
Run Code Online (Sandbox Code Playgroud)

我可以在终端中很好地运行这行代码,但是当我00-header使用此信息进行编辑时,我会以纯文本形式打印出转义码:

Welcome to \e[1;36mUbuntu 13.10\e[0m \e[2m(GNU/Linux 3.11.0-23-generic i686)\e[0m
Run Code Online (Sandbox Code Playgroud)

如何为当天的信息添加一点色彩?

shell colors ubuntu motd

20
推荐指数
2
解决办法
3万
查看次数

如何在 Debian Jessie 8.2 中为 ssh 设置动态每日消息 (motd)?

我想要一个动态的 motd,但我不知道该怎么做。

我试了一下,我发现,加入/etc/update-motd.d/00-header10-sysinfo90-footer,和符号链接到/etc/motd /var/run/motd.dynamic/run/motd.dynamic/run/motd/var/run/motd

我有这些行/etc/pam.d/sshd

# Print the message of the day upon successful login.
# This includes a dynamically generated part from /run/motd.dynamic
# and a static (admin-editable) part from /etc/motd.
session    optional     pam_motd.so  motd=/run/motd.dynamic
session    optional     pam_motd.so noupdate
Run Code Online (Sandbox Code Playgroud)

我也对 systemd 感到困惑。

有没有办法做到这一点?有人可以提供一个简单的财富的例子吗?

ssh debian motd systemd

19
推荐指数
2
解决办法
3万
查看次数

使用 sftp 时如何防止出现“上次登录:”消息?

在Ubuntu的GNU / Linux 12.04,我有一个用户johndoe,其为部分sftponly基团,设立sftp到一个chroot使用监狱

Subsystem sftp internal-sftp

Match Group sftponly
        ChrootDirectory %h
        ForceCommand internal-sftp
        AllowTcpForwarding no
Run Code Online (Sandbox Code Playgroud)

/etc/ssh/ssh_config. 用户home目录的所有组件都是 -root拥有的目录,任何其他用户或组都不能写入,如man sshd_config(下ChrootDirectory)中所述。在他的chroot监狱里,有一个可写的目录files

sudo groupadd sftponly    
sudo mkdir -p /home/sftponly/johndoe/files
sudo useradd -d /home/sftponly/johndoe -g sftponly -s /usr/sbin/nologin johndoe
sudo chmod go-w /home/sftponly/{,johndoe}
sudo chown johndoe:sftponly /home/sftponly/johndoe/files
sudo chmod ug+rwX /home/sftponly/johndoe/files
Run Code Online (Sandbox Code Playgroud)

(将外壳设置/bin/falsessh或 都不起作用sftp。随着nologin外壳 …

ssh sftp openssh motd

10
推荐指数
1
解决办法
1万
查看次数

我可以自定义“您有新邮件”消息吗

You have new mail当您通过 SSH 登录时,我正在尝试修改显示在 MOTD 下方的消息。我的目标是使该消息更加明显(明亮的颜色会很棒),以便在我登录时引起我的注意。

bash ssh email motd

9
推荐指数
1
解决办法
229
查看次数

命名管道时不显示/etc/motd?

运行 Gentoo 3.4.0

最近听说过 /etc/motd 文件后,我试图让它显示随机的 cowsay 命运。我编写了一些随机的 bash 脚本来充当守护进程,将 /etc/motd 作为命名管道提供,如某些论坛上所见。

我不认为脚本有任何问题,因为 cat'ing 管道工作得很好,但 MOTD 不会在登录时显示(使用常规文件有效)!

fira@nyan ~ % cat /etc/motd
 _______________________________________ 
/ We didn't put in ^^ because then we'd \
| have to keep telling people what it   |
| means, and then we'd have to keep     |
| telling them why it doesn't short     |
| circuit. :-/                          |
|                                       |
| -- Larry Wall in                      |
\ <199707300650.XAA05515@wall.org>      /
 --------------------------------------- 
   \
    \
        .--.
       |o_o | …
Run Code Online (Sandbox Code Playgroud)

linux login gentoo motd

8
推荐指数
1
解决办法
1066
查看次数

Motd 不显示

我想在我的机器上设置一个自定义的 motd(“今日消息”)(目前是 Mac OS X 10.6.5,使用 Bash 和 Terminal.app)。

/etc/没有MOTD文件,所以我创建了一个与一些示例文本。但是当我重新启动终端时该消息没有显示。我试过logout然后login但它似乎仍然没有开始。

如果我这样做了ls -l /etc/motd(如果有任何线索):

-rw-r--r-- 1 root wheel 30 7 Dec 11:58 /etc/motd

我错过了什么吗?

osx motd

7
推荐指数
1
解决办法
5362
查看次数

Motd 不变

我的 /etc/motd 文件显示重复的消息。当我手动编辑它时,每当用户登录时,它都会返回到混乱的版本。我该如何阻止?我正在使用 Ubuntu 10.04

ubuntu motd

5
推荐指数
2
解决办法
1万
查看次数

Disable SSH MOTD/Banner for a specific user

I have a custom shell in /bin/that returns an echo and exists. I have a user that is exclusively linked to that shell only so that when someone tries to ssh into the server using that user via pubkey only, the custom shell will echo something and exit immediately (closes the ssh conenction right after the echo).

The problem is that it's working but it's showing the default Ubuntu MOTD / Banner after the authentication, while i only want …

linux ssh ubuntu motd banner

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

motd ×10

ssh ×4

linux ×3

login ×3

ubuntu ×3

bash ×2

banner ×1

colors ×1

debian ×1

email ×1

gentoo ×1

openssh ×1

osx ×1

sftp ×1

shell ×1

systemd ×1