是否有可能在Ubuntu的基础上login的用户组打印一个不同的motd文件?
我想为pipe理员和普通用户在login到我的Ubuntu 9.10服务器时显示不同的motd消息。
我已经看了PAM文档和pam_motd模块的文档,没有任何答案。
您可能会更快地将一个shell脚本添加到/ etc / profile文件的末尾来执行组检查,然后吐出一条消息
就像是:
#!/bin/bash # script at /usr/local/bin/motdcheck PGROUP=`groups|awk '{print $1}'` cat /etc/motd.${PGROUP}
将作为脚本运行,输出名为/etc/motd.groupname的文件,其中groupname是用户组列表中的第一个组。
每次打开新的loginshell时,都会运行/ etc / profile中的所有内容。