Tim Bezhashvyly
Tim Bezhashvyly

Reputation: 9100

Suppress welcome message on bash remote command execution

I'm executing some commands on remote server within a shell script like this:

ssh user@host <<ENDSSH
...
ENDSSH

Upon login I'm getting a standard server welcome message echoed. Is there a way to send it to \dev\null but to keep displaying the output of executed commands?

Thanks.

Upvotes: 5

Views: 1730

Answers (2)

Dan
Dan

Reputation: 11084

You can edit /etc/ssh/sshd_config (for debian/ubuntu, your server might be different file) and turn the following setting to 'no'.

 PrintMotd no
 PrintLastLog no

Upvotes: 1

chepner
chepner

Reputation: 531235

Create a file ~user/.hushlogin on the remote host. This will suppress output from the login program when user logs in (such as time of last login and any message of the day).

Upvotes: 4

Related Questions