What I saw
While copying a file from a server, I ran:
scp user@your-server:/path/to/backup.dump ./
The terminal first printed a welcome message or a piece of ASCII art, something like this:
_____ _ __ __
/ ___/___ ______ __(_)_______ / /____/ /
\__ \/ _ \/ ___/ | / / / ___/ _ \/ __/ _ /
___/ / __/ / | |/ / / /__/ __/ /_/ __/
/____/\___/_/ |___/_/\___/\___/\__/\___/
Authorized access only.
It appeared during both an ssh login and an scp transfer.
That detail matters. The output probably comes from a Banner set on the SSH server, rather than an ordinary /etc/motd.
The likely source
When the same welcome message or ASCII art appears during both ssh login and scp transfers, the most likely source is:
/etc/ssh/sshd_config éē Banner é
ē½®
For example:
Banner /etc/ssh/banner
OpenSSH sends the configured Banner from the server to the client during authentication. Both scp and sftp use SSH underneath, so they display the same authentication banner.
This also explains why scp can display ASCII art without usually damaging the transferred file. The banner is an authentication message in the SSH protocol, separate from the stdout stream carrying file content.
Banners, motd, and shell startup scripts
These common login messages appear at different points:
| Source | Usual location | When it appears | Effect on scp |
|---|---|---|---|
| SSH banner | Banner directive in /etc/ssh/sshd_config | During SSH authentication | Displayed |
| motd | /etc/motd, /etc/update-motd.d/ | After login, printed by PAM or a system script | Usually only affects interactive logins |
| issue.net | /etc/issue.net | OpenSSH does not use it automatically, but it is often the file named by Banner | Depends on whether Banner references it |
| Shell startup script | /etc/profile, ~/.bashrc, ~/.profile | When the shell starts | Can interfere and may even break legacy scp |
So when scp displays the text too, check the SSH banner first.
How to find it
First, inspect the effective sshd configuration:
sudo sshd -T | grep '^banner'
If you see something like:
banner /etc/ssh/banner
then the banner file is /etc/ssh/banner.
You can also grep the configuration files directly:
grep -i '^[[:space:]]*Banner' /etc/ssh/sshd_config
grep -Ri '^[[:space:]]*Banner' /etc/ssh/sshd_config.d/ 2>/dev/null
Once youāve found the path, inspect the contents:
cat /etc/ssh/banner
If the actual path differs from /etc/ssh/banner, substitute the file that grep found.
Where to look if it isnāt the banner
If sshd -T shows:
banner none
then inspect the files used for post-login messages:
cat /etc/motd
ls -la /etc/update-motd.d/ 2>/dev/null
cat /etc/issue.net 2>/dev/null
You can also search for distinctive words in the ASCII art:
grep -R "Welcome\|Authorized access\|____" /etc /root 2>/dev/null
Take special care if you find the content in a shell startup script such as /etc/profile, ~/.bashrc, or ~/.profile. Unsolicited output in noninteractive sessions can interfere with scp, rsync, and automation scripts.
Can I configure this in my cloud providerās console?
Cloud consoles generally donāt offer a dedicated āSet SSH login ASCII artā or āSet SSH bannerā button.
The content can still reach a machine through features available in a cloud providerās UI. Three sources are common.
1. Instance user data
When you create a cloud server, the console usually provides an āinstance custom dataā, āuser dataā, or ācloud-initā field.
If you supplied an initialization script, it may have run something like this:
cat > /etc/ssh/banner <<'EOF'
...
EOF
echo 'Banner /etc/ssh/banner' >> /etc/ssh/sshd_config
systemctl restart sshd
Check the traces left by cloud-init:
sudo cat /var/lib/cloud/instance/user-data.txt 2>/dev/null
sudo ls -la /var/lib/cloud/instance/scripts/ 2>/dev/null
sudo cloud-init status --long 2>/dev/null
If the user data contains the command that wrote the banner, youāve found its source.
2. A custom or marketplace image
If the server booted from a custom image, a marketplace image, a preconfigured environment image, or a control-panel image, the banner may have been baked into it.
In that case, the image builder configured the banner before you launched this instance.
Check the banner fileās modification time:
stat /etc/ssh/banner
If itās close to the time the system was initialized, the image or an initialization script is the likely source.
3. Someone configured it manually
The cloud provider may have had no involvement. Someone could have logged in and configured the banner by hand.
The same two checks help:
- Where
Bannerinsshd_configpoints - The modification time and contents of that banner file
If those match what you see, thereās no need to keep hunting for a switch in the console.
How to disable or change it
First confirm the current configuration:
sudo sshd -T | grep '^banner'
Suppose the output is:
banner /etc/ssh/banner
To change the message, edit that file directly:
sudo vim /etc/ssh/banner
To disable the banner entirely, edit the sshd configuration:
sudo vim /etc/ssh/sshd_config
Change:
Banner /etc/ssh/banner
to a comment:
# Banner /etc/ssh/banner
or use:
Banner none
After editing, validate the configuration before restarting anything:
sudo sshd -t
If validation succeeds, reload the configuration:
sudo systemctl reload sshd
If the system doesnāt support reloading, use:
sudo systemctl restart sshd
When changing SSH configuration remotely, keep your current SSH session open and try logging in from a new terminal. That way a configuration mistake neednāt lock you out.
In brief
When both ssh and scp show the same ASCII art, start by checking the SSH banner.
The diagnostic sequence is short:
sudo sshd -T | grep '^banner'
grep -i '^[[:space:]]*Banner' /etc/ssh/sshd_config
If you see Banner /some/file, that file contains the ASCII art.
Cloud consoles usually lack a dedicated banner setting, but initialization scripts, cloud-init, and custom or marketplace images can all install one. The definitive evidence is the serverās sshd_config and the actual banner file.