LoginSignup
0
0

More than 1 year has passed since last update.

"Activate the web console with: systemctl enable --now cockpit.socket"をアンインストールなく非表示する

Posted at

RHEL8/CentOS8にログインすると以下の表示が出ますよね。

うっとおしいやつ
Activate the web console with: systemctl enable --now cockpit.socket

Last login: Sat Jan 29 22:52:18 2022 from 192.168.xxx.xxx
[root@hostname ~]#

cockpitというRHEL8以降のWebコンソールについてのアナウンスですが、利用しない場合には上記のメッセージが出ますし、利用したらしたで以下のメッセージが出ます。

うっとおしいやつ2
Web console: https://hostname:9090/ or https://192.168.xxx.xxx:9090/

Last login: Sat Jan 29 22:52:18 2022 from xxx.xxx.xxx.xxx
[root@hostname ~]#

cockpit自体は利用しないけど、cockpit自体をdnf removeするまではな~~というときの対応です。

1.特定ユーザのみ表示しないようにする

以下でファイルを作成してください。

特定ユーザだけうっとおしいのを消す
touch ~/.hushlogin

2.全ユーザで表示しないようにする

以下でファイルを消してください。

全ユーザでうっとおしいのを消す
rm /etc/motd.d/cockpit

3.動作の詳解

このうっとおしいメッセージですが、/etc/motd.d/cockpitファイルが存在することで、motdによるログインメッセージ表示をトリガーとして動作しています。

よって、motdファイルの表示を抑制する手法を取ることで表示を消すことが出来るというわけです。

#なので、openssh側(/etc/ssh/sshd.config)でBanner noneしてsystemctl restrat sshdする方法などもあります。



また、cockpitプロセスを動作しているかしていないかでメッセージが変わる点ですが、/etc/motd.d/cockpitのリンク先が変わっていることが原因でした。

3-1.cockpitを停止している状態

[root@cent83-01 ~]# ll /etc/motd.d/cockpit
lrwxrwxrwx. 1 root root 17  8月 25  2020 /etc/motd.d/cockpit -> /run/cockpit/motd

[root@cent83-01 ~]# ll /run/cockpit/motd
lrwxrwxrwx 1 root root 37  1月 29 22:36 /run/cockpit/motd -> /usr/share/cockpit/motd/inactive.motd

[root@cent83-01 ~]# ll /usr/share/cockpit/motd/inactive.motd
-rw-r--r--. 1 root root 70  8月 19  2020 /usr/share/cockpit/motd/inactive.motd

[root@cent83-01 ~]# cat /usr/share/cockpit/motd/inactive.motd
Activate the web console with: systemctl enable --now cockpit.socket

[root@cent83-01 ~]#

3-2.cockpitを起動している状態

[root@cent83-01 ~]# ll /etc/motd.d/cockpit
lrwxrwxrwx. 1 root root 17  8月 25  2020 /etc/motd.d/cockpit -> /run/cockpit/motd

[root@cent83-01 ~]# ll /run/cockpit/motd
lrwxrwxrwx 1 root root 11  1月 29 23:09 /run/cockpit/motd -> active.motd

[root@cent83-01 ~]# ll /run/cockpit/active.motd
-rw-r--r-- 1 root root 70  1月 29 23:09 /run/cockpit/active.motd

[root@cent83-01 ~]# cat /run/cockpit/active.motd
Web console: https://hostname:9090/ or https://192.168.xxx.xxx:9090/

[root@cent83-01 ~]#



これですっきり:relaxed:

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0