← Servers, deploying and APIs

Lesson 3 of 20 · Try it · 30 min

1.3 Hands-on: log in with SSH

You'll log in to your server from your laptop for the first time, and change its password.

Open a terminal on your laptop

  • Windows 10 or 11: press the Windows key, type PowerShell, and open it.
  • Mac: press Cmd + Space, type Terminal, and open it.
  • Linux: open Terminal.

Steps

  1. In Lynk, open Servers, then Server access, and click Show login. You'll see a line like ssh root@203.0.113.10, and a password with a copy button.
  2. In your terminal, type the ssh line exactly as shown (with your server's IP address), and press Enter.
  3. The first time, it asks Are you sure you want to continue connecting? Type yes and press Enter. (Your laptop is remembering this server.)
  4. It asks for the password. Click the copy button in Lynk, then paste into the terminal (right-click in PowerShell; Cmd + V on a Mac). Nothing appears as you paste. That's normal. Press Enter.
  5. You're in when the line ends with something like root@…:~#. Everything you type now runs on the server.
  6. Change the password: type passwd, press Enter, type a new long password twice (nothing shows), and save it in your password manager.
  7. Try a few safe commands, one at a time:
  • hostname (the server's name)
  • df -h (how full the disk is)
  • free -h (memory)
  • uptime (how long it's been on)
  1. Type exit to log out. You're back on your laptop.

If it doesn't work

  • Connection timed out: check the IP address, and that the server shows Active.
  • Permission denied: the password is wrong. Copy it again. After 5 wrong tries, the server blocks your internet address for an hour (that's the password-guessing protection). Wait, or use another network.
  • Forgot the password you set? Controls → New password gives the server a new root password, shown under Server access.

Check your work: you logged in, changed the password, and logged out with exit.

Try it in Lynk

Now do it yourself. When you're done, come back here and mark this lesson done.

Sign in to try it
Next lesson

Sign in to save your progress and earn the certificate.

1.2 Buy a server, and its page in Lynk