5

修改服务器的Message of The Day

 3 years ago
source link: https://enoch2090.me/2021/01/23/tech/%E4%BF%AE%E6%94%B9%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84Message%20of%20The%20Day/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

修改服务器的Message of The Day

Enoch2090

2021-01-23

之前搞了个脚本,可以自动把训练进度更新到Notion上。但是那个项目的页面不是所有人都顾着去看,加上实验室里同时进行的项目有好几个,有一台服务器上可能会跑各种训练,之间难免起冲突。

为了防止误操作,我把那台服务器的motd(Message of the Day)更新了一下。方法如下:

sudo apt-get install update-motd
sudo chmod -x /etc/update-motd.d/*

这一步安装update-motd这个包并且禁用了默认的所有motd。然后

sudo nano /etc/update-motd.d/graphic-card-stats

新建一个文件,输入:

#! /bin/sh
neofetch
nvidia-smi

这里面还调用了一下neofetch命令,安装方法见dylanbaraps/neofetch。保存退出,exit退出ssh连接,重新登录即可:

updateMotd

Motd能不能算是UNIX系统的精髓?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK