World map

 

BM: Baca dalam Bahasa Melayu

World L4: Remote Kitchens

Short names: ~/.ssh/config

You will learn: to call a server by a short name with your own speed dial.

Checked with Linux (Debian 13) on 1 Nov 2026

The problem

laptop (lab)
ssh you@10.0.0.5 hostname
kedai
ssh kedai hostname
kedai
ssh you@10.0.0.5 hostname prints kedai. ssh kedai hostname prints kedai too.

Same kitchen, two ways to call. Who wants to remember numbers? The second one uses a speed dial.

Watch

Your speed dial is ~/.ssh/config: Your speed dial: a short name like kedai stands for the address, user and key.. Host is the short name. Tap the line with the real address.

Tap the real address.

0 of 1 found

Try it

This speed dial misses your user name. And anyone may change it! Add the line User you, then chmod 600 the file.

You are you in /home/you. 0 things here. Services: cron running, ssh running, nginx running.

You are hereyou@kedai:~$

Folder ~

Empty folder

+ 4 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

Watch

laptop (lab)
ssh -G kedai | grep -E '^(hostname|user|port|identityfile) '
user you
hostname 10.0.0.5
port 22
identityfile ~/.ssh/id_ed25519
ssh -G kedai shows what ssh will use: user you, hostname 10.0.0.5, port 22, identityfile ~/.ssh/id_ed25519.

ssh -G shows what ssh will really use, without calling. Great for checking typos.

Predict

Your config file is -rw-rw-rw- (666): anyone can change it. What does ssh do?

Pick one answer.

Check

True or not?

Swipe right for good, left for needs work. Or use the buttons.

1 / 3

The short name kedai only works on this laptop.

The short name kedai only works on this laptop.

You did it!

You can now call a server by a short name.

Go deeper (optional)

More lines: Port 2222 for another extension, Host * for settings that fit every server. The real error for a loose file is Bad owner or permissions on /home/you/.ssh/config. The lab outputs came from real Debian 13 machines.

Real mission

  1. chmod 600 ~/.ssh/config
  2. ssh -G myvm | head
  3. ssh myvm

0 of 4 steps done · Your ticks are saved.