ssh login without welcome banner
Try ssh -q to supress the banner message
You should be able to silence this banner, and other diagnostic messages, by passing -q
to SSH:
ssh -q user@remote_host
If you want to make -q
permanent for all your SSH sessions, do:
echo "LogLevel QUIET" >> ~/.ssh/config
This will run command1 command2 and command3 on the remote_host.
ssh user@remote_host 'command1; command2; command3'
No banners are displayed.
What works here seems to depend on the operating system, SSH version, and the server-side configuration of sshd
.
For connecting to a stock Ubuntu 18 server ssh -q
didn't work for me, and neither did ssh -o LogLevel=error
that is suggested elsewhere.
What did work is the comment posted under the question about creating a .hushlogin
file in the remote user's home directory:
$ ssh myuser@myhost
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-55-generic x86_64)
<snip>
Last login: Thu Aug 1 14:04:26 2019 from 1.2.3.4
myuser@myhost$ touch .hushlogin
myuser@myhost$ exit
Then:
$ ssh myuser@myhost echo 'Test'
Test