Why ASCII art appears during both SSH login and scp: tracking down an SSH banner

June 28, 2026

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:

SourceUsual locationWhen it appearsEffect on scp
SSH bannerBanner directive in /etc/ssh/sshd_configDuring SSH authenticationDisplayed
motd/etc/motd, /etc/update-motd.d/After login, printed by PAM or a system scriptUsually only affects interactive logins
issue.net/etc/issue.netOpenSSH does not use it automatically, but it is often the file named by BannerDepends on whether Banner references it
Shell startup script/etc/profile, ~/.bashrc, ~/.profileWhen the shell startsCan 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:

  1. Where Banner in sshd_config points
  2. 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.

Ā© 2026 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2026-06-28). Why ASCII art appears during both SSH login and scp: tracking down an SSH banner. https://caiborui.com/blog/2026-06-28-zh-ssh-banner-scp-ascii-art-entrans

@misc{borui2026-412b48ee,
  author = {borui},
  title = {{Why ASCII art appears during both SSH login and scp: tracking down an SSH banner}},
  year = {2026},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2026-06-28-zh-ssh-banner-scp-ascii-art-entrans}
}