我试图为临时用户设置自定义 shell。
sudo usermod --shell /home/nemo/a temp
Run Code Online (Sandbox Code Playgroud)
内容一:
#!/bin/bash
echo "Test"
Run Code Online (Sandbox Code Playgroud)
不幸的是,在尝试以 user 身份登录时temp,我看到了:
Nautilus login: temp
Password:
Last login: Sat Oct 22 01:33:33 IST 2011 on pts/1
Welcome to Ubuntu 11.10 (GNU/Linux 3.0.0-12-generic i686)
* Documentation: https://help.ubuntu.com/
0 packages can be updated.
0 updates are security updates.
Test
Run Code Online (Sandbox Code Playgroud)
我想删除出现的通知。
我刚刚过渡到 Ubuntu Linux 12.10,我想正确设置我的第一个 motd。我在下面运行了以下内容,并注意到我只有一个 motd 文件,而不是大多数 Ubuntu 版本似乎都有一个名为 motd.tail 的辅助文件。我应该创建 motd 文件的备份副本,然后写入该文件,还是直接写入该文件?另外,一旦我写了这个文件,我是否需要让它可执行以显示消息?
ls -l motd* // output: motd -> /var/run/motd
Run Code Online (Sandbox Code Playgroud) 正如 AskUbuntu(多线程)上的详细说明,我正在尝试更改当天的消息。
这是我的编辑:
luis@Terminus:/etc$ cat /etc/motd.tail
____ _ _ ____
/ ___| ___ _ __ __ _| | __ _ (_) ___ / ___| ___ _ ____ ____ _
\___ \ / _ \| '_ \ / _` | |/ _` || |/ _ \ \___ \ / _ \ '__\ \ / / _` |
___) | (_) | |_) | (_| | | (_| || | (_) | ___) | __/ | \ V / (_| …Run Code Online (Sandbox Code Playgroud) 我在 wsl2 上安装了 update-motd 软件包,但如何激活它,以便每次打开新的终端会话/选项卡时它都会显示该消息?接下来我该怎么办?
我的 Ubuntu 18.04 和“今日消息”不再起作用。当我登录时没有显示任何信息。
当我跑步时
run-parts /etc/update-motd.d/
Run Code Online (Sandbox Code Playgroud)
我收到一个错误
run-parts: /etc/update-motd.d//50-landscape-sysinfo exited with return code 2
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
当我登录到终端/通过 SSH 时,我看到此消息,其中x有许多更新:
x packages can be updated.
x updates are security updates.
Run Code Online (Sandbox Code Playgroud)
但是,如果两者的数字都是 0,我不希望看到该消息。
我试过修改 MOTD 文件,但从我所见,我可以允许它们显示或隐藏它们,但没有任何条件。该90-updates-available文件的内容是:
#!/bin/sh
stamp="/var/lib/update-notifier/updates-available"
[ ! -r "$stamp" ] || cat "$stamp"
Run Code Online (Sandbox Code Playgroud)
...的内容/var/lib/update-notifier/updates-available是:
0 packages can be updated.
0 updates are security updates.
Run Code Online (Sandbox Code Playgroud)
90-updates-available如果两条消息都以 开头,如何修改文件以防止显示消息0?
我有一个在 sandbox.plushu.org 上运行的 Ubuntu 服务器 - 如果你在http://enter.sandbox.plushu.org添加你的密钥,你可以以 root@sandbox.plushu.org 的身份连接到服务器。您可以通过按下http://reset-sandbox.plushu.org上的重置按钮来重置服务器。
我在这台服务器上有一个自定义的时间敏感 MOTD。我看到的问题是这个 MOTD 在登录时重新生成(通过 /etc/update-motd/*)时,直到下次登录时才会显示。第一次登录时,您将看到启动时生成的 MOTD:下次登录时,您将看到上次登录时生成的 MOTD 。
是什么导致了这种行为?如何修复,以便在登录时生成并显示MOTD ?
在wireshark 日志中,我发现我的 Lubuntu 18.04 调用了Amazon servers。看到这个日志:
17 192.168.1.1 192.168.1.13 DNS 118 Standard query response 0x0e33 A motd.ubuntu.com A 54.194.229.79 A 52.18.210.215 OPT
18 192.168.1.1 192.168.1.13 DNS 142 Standard query response 0xebef AAAA motd.ubuntu.com AAAA 2a05:d018:91c:3200:4a81:cf9a:267b:97df AAAA 2a05:d018:91c:3200:5869:6d03:bf3a:f619 OPT
19 192.168.1.13 54.194.229.79 TCP 74 50656 > 443 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=4010357077 TSecr=0 WS=128
20 54.194.229.79 192.168.1.13 TCP 74 443 > 50656 [SYN, ACK] Seq=0 Ack=1 Win=26847 Len=0 MSS=1380 SACK_PERM=1 TSval=2116889653 TSecr=4010357077 WS=128
21 192.168.1.13 54.194.229.79 TCP …Run Code Online (Sandbox Code Playgroud)