run commands on a server over ssh
Run one command or a whole local script on another machine, without logging in by hand.
network
steps
-
ssh NAME@host 'uptime'one command; its output comes back here
-
ssh NAME@host 'cd /app && git pull && sudo systemctl restart app'several, in order
-
ssh NAME@host 'bash -s' < local-script.shrun a script from this machine there
-
ssh -t NAME@host 'sudo systemctl restart app'one that asks for a password (-t gives it a terminal)
-
ssh NAME@host 'cat /var/log/app.log' > app.logbring a file's text back
commands used
ssh
Each has a page in lore: lore ssh opens it.
check a certificate
See a site's TLS certificate, when it expires and who issued it, or the same for a .pem file.
copy files to and from a server
Copy a file or a whole folder between this machine and another one over ssh.
download a whole folder from a website
Fetch every file under a web folder, without climbing to the folders above it.
find this machine's ip address
This machine's address on the local network, and the one the internet sees.