Score:0

How to disable Web Console and Red Hat Insights prompt on login to RHEL8 via SSH?

ck flag

Whenever I log into my RHEL8 server via SSH, I get these lines printed:

Web console: https://<myserver>:9090/ or https://<myip>:9090/

This system is not registered to Red Hat Insights. See https://cloud.redhat.com/
To register this system, run: insights-client --register

How do I disable those prompts?

Score:1
ck flag

I figured it out before I finished writing this question so I figured I'd just share this with anyone else.

# ls /etc/motd.d -lh
total 0
lrwxrwxrwx. 1 root root 17 Mar 12 19:46 cockpit -> /run/cockpit/motd
lrwxrwxrwx. 1 root root 41 Jun 18 22:01 insights-client -> /etc/insights-client/insights-client.motd

Each one of those symlinks prints something to the SSH terminal on login. In this case, cockpit prints the web console message and insights-client prints the insights prompt.

Therefore just do this:

# cd /etc/motd.d
# [sudo] rm -f cockpit insights-client

Verified to work and persist across restart on RHEL8.4.

Score:1
ca flag

As this is caused mainly by the pam_motd.so PAM module the better approach is to comment it out in file /etc/pam.d/sshd, changing the line from

session    optional     pam_motd.so

to

# session    optional     pam_motd.so

After restarting the SSH daemon via

systemctl restart sshd

the messages will not be displayed, as well not MOTD a second time.

The configuration could be done via an Ansible task

- name:  Make sure that it is removed Web console message on user login in RHEL 8
  lineinfile:
    path: /etc/pam.d/sshd
    regexp: '^session    optional     pam_motd.so'
    line: '# session    optional     pam_motd.so'

or via CLI and sed

sed -i 's/session    optional     pam_motd.so/# session    optional     pam_motd.so/g' /etc/pam.d/sshd
# or more generic
sed '/session    optional     pam_motd.so/s/^/# /g' /etc/pam.d/sshd

Further Documentation

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.