Suppress SSH login notifications

Suppress SSH login notifications

We regularly see that the so-called deploy services suffer from output that we generate when logging in via SSH (e.g. pre-login/motd). This output has the function to show the user important information, but in the case of automatic processes this is not always desirable. This behavior is often fairly easy to fix.

In all cases you need to pass the -q parameter in the SSH command (we assume you are using the OpenSSH client). This will suppress the pre-login message. To also skip the Last Login message you need to create a .hushlogin file ( touch ~/.hushlogin ) on your server.

A deploy process can log in in 2 ways, namely with a:

Login shell

In a login shell the .bash_profile is read and the MOTD is also shown. You can suppress this in 2 ways:

  • NOMOTD=true ssh -q -o SendEnv=NOMOTD @d-example.host-ed.eu -p 22622 use (when using the OpenSSH client)
  • By creating the file ~/.no-motd and in the home directory. This is the most drastic way because normal users will not see the message anymore.

Non-interactive shell

In this case the .bash_profile file is ignored and you just need to pass the -q parameter with SSH and create the .hushlogin file.


    • Related Articles

    • Automatic SSH deployment

      The portal offers the possibility to automatically roll out SSH keys of portal users, who are members of your team, to the different servers. Under “SSH User keys” it is explained how you can do this as a user. If you remove a team member from your ...
    • SSH Tips for Professionals

      SSH is one of the most used tools by us and by most developers. In this blog we share a number of tips that make SSH both more secure and efficient. These tips are not only applicable to our high performance web servers, but also to your own internal ...
    • Creating a database backup

      Before you make any changes to your web application, it is always a good idea to make a backup of your database first. If something goes wrong, you can easily go back to the original situation. Fortunately, making a database backup is quite easy, as ...
    • Add domain to spam filter

      As a LinQhost customer, it has recently become possible for you to manage your own spam filter. You can register domains on the spam filter yourself, remove emails from quarantine and of course set up your own whitelist/blacklist. Register domain on ...
    • Transferring a domain: requesting a domain token or EPP code

      Are you planning to transfer your domain? Then you need a domain token or EPP code to make the transfer go smoothly. In this blog we explain how you can easily request this code, so that your transfer goes smoothly. Why do you need a token or EPP ...