Skip to content

Kata1: New user needs old file

This first kata trains the situation where you are stranded on a foreign system and you have to retrieve some important file from your own system.

The steps are simple:

  • Create a new user with sudo rights on a new system
  • Create an ssh key and login via SSH on your original system
  • Move a file to your new account
Open console
sudo -i
useradd -m -s /bin/bash user2
passwd user2
usermod -aG [sudo / wheel] user2
exit
su - user2
cd ~
sudo ls -al
ping 192.168.123.38
ssh user1@192.168.123.38   (with password)
exit
ssh-keygen -t ed25519
ssh-copy-id user1@192.168.123.38
ssh user1@192.168.123.38   (without password)
ls -al > files.txt
exit
scp user1@192.168.123.38:files.txt .
cat files.txt
exit

The idea is that you practice this kata until you know it by heart, and then practice it periodically among other katas. Also practice it under different conditions, such as a different OS, without mouse, on a laptop, when you're tired, etc.

Once you master it, it also becomes time to look into the background of the steps. Do some research on the commands, discover all options, and tailor the kata to your personal wishes.