SSH and remote machines
Connect securely, copy files and use keys instead of passwords.
What you will be able to do
- Use ssh user@host to connect.
- Generate keys with ssh-keygen -t ed25519.
- Copy a public key with ssh-copy-id.
- Use rsync for repeatable file sync.
In plain English
SSH encrypts a remote shell session. Use key authentication, keep the private key local and never paste it into a chat or a repository. scp and rsync copy files over the same secure channel.
ssh-keygen -t ed25519 -C "you@example.com"
ssh-copy-id deploy@example.com
ssh deploy@example.com 'uname -a'
rsync -avz ./dist/ deploy@example.com:/var/www/app/Your turn
MediumCopy a project
Write an rsync command that copies ./dist/ to /var/www/app/ on deploy@example.com.
BASH · starter
rsyncCheck your understanding before moving on.
Knowledge checkQuestion 1
Which file is copied to a server for key authentication?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.