Silencing SSH Login and MOTD on Raspberry Pi

I was trying to do a simple transfer with rsync (via ssh) and ran into an issue. I remember seeing “error 2” and “Is your shell clean?”

How did my shell get dirty?

After a brief search I found that any kind of MOTD or printed login information would be bad for rsync. In other words, rsync expects to receive nothing when accessing a remote system and MOTD and friends would give it something.

To remove everything (this was on a fresh install of Raspbian Bookworm):

# the nuclear option

# delete MOTD
sudo rm /etc/motd

# delete the dynamic MOTD script for uname
sudo rm /etc/update-motd.d/10-uname

# silence anything else with this hidden file in $HOME
touch ~/.hushlogin