Linux commands
Connecting
Command
Does
Where
ssh homeserver
Log in through your home shortcut
Mac / PC
ssh homeserver-remote
Log in through Tailscale
Mac / PC
ssh alex@192.168.1.50
Log in without a shortcut
Mac / PC
exit
Log out (back to your own computer)
server
ssh homeserver 'df -h /'
Run one command and come back
Mac / PC
ssh -v homeserver
Connect and show every step (for fixing problems)
Mac / PC
Keys
Command
Does
Where
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_homeserver -C "mac-homeserver"
Make a new key pair
Mac / PC
cat ~/.ssh/id_ed25519_homeserver.pub
Show the public key (safe to share)
Mac / PC
ssh-copy-id -i ~/.ssh/id_ed25519_homeserver.pub alex@homeserver.local
Put the public key on the server (Mac/Linux)
Mac
ssh-keygen -lf ~/.ssh/id_ed25519_homeserver.pub
Fingerprint of a key
Mac / PC / server
ssh-keygen -lf ~/.ssh/authorized_keys
Fingerprints of every key allowed in
server
ssh-keygen -p -f ~/.ssh/id_ed25519_homeserver
Change a key's passphrase
Mac / PC
ssh-add -l
Keys loaded in the agent (no passphrase needed)
Mac / PC
ssh-add --apple-use-keychain ~/.ssh/id_ed25519_homeserver
Remember the passphrase in Keychain
Mac
ssh-add -D
Remove all keys from the agent
Mac / PC
The file ~/.ssh/authorized_keys on the server = one line per allowed device . Delete a line to lock that device out.
Shortcuts file
~/.ssh/config on your Mac (C:\Users\alex\.ssh\config on Windows):
Host homeserver
HostName homeserver.local
User alex
IdentityFile ~/.ssh/id_ed25519_homeserver
IdentitiesOnly yes
ssh -G homeserver shows the final settings SSH will use, handy to check which key and address a shortcut picks.
Copying files
Command
Does
scp photo.jpg homeserver:~/
Mac/PC → server home folder
scp homeserver:~/report.txt .
Server → the folder your terminal is in
scp -r FOLDER homeserver:~/
A whole folder
rsync -avh --progress FOLDER/ homeserver:~/FOLDER/
Copy only what changed; can resume (needs rsync on both sides)
Tunnels
ssh -N -L 18095 :127.0.0.1:8095 homeserver
-L 18095 : 127.0.0.1 : 8095
│ │ └── port on the server
│ └────────────── address as seen from the server (itself)
└─────────────────────── port on YOUR computer: open http://127.0.0.1:18095
-N just hold the tunnel open, no shell
Tunnel
Command
Then open
AI chat
ssh -N -L 18095:127.0.0.1:8095 homeserver
http://127.0.0.1:18095
Agent dashboard
ssh -N -L 18765:127.0.0.1:8097 homeserver
http://127.0.0.1:18765
Cockpit
ssh -N -L 19090:127.0.0.1:9090 homeserver
http://127.0.0.1:19090
Add -o ExitOnForwardFailure=yes to make it stop with an error instead of silently not working.
Server side
Command
Does
sudo sshd -t
Check the SSH settings for mistakes (no output = OK)
sudo sshd -T | grep -i password
What SSH really uses for a setting
sudo systemctl reload ssh
Apply new settings without dropping current logins
sudo journalctl -u ssh -n 50
Recent logins and failures
who
Who is logged in now
last -n 20
The last 20 logins
Common errors
Message
Fix
Permission denied (publickey)
Wrong key or no key on the server. Check ssh -G homeserver, and authorized_keys permissions (600)
Could not resolve hostname
Name not found. Use the number, or turn Tailscale on
Connection timed out
Server off, asleep, wrong network, or firewall
Connection refused
SSH isn't running: sudo systemctl start ssh
REMOTE HOST IDENTIFICATION HAS CHANGED
After a reinstall: ssh-keygen -R homeserver.local
bind: Address already in use
An old tunnel is still open. Close it
administratively prohibited
The server doesn't allow tunnels: check AllowTcpForwarding
Previous Network Next Services and logs