🔎Julia Evans🔍 on Twitter: “ssh tips… “
Posted by jpluimers on 2021/01/08
Great work by [WayBack]  🔎Julia Evans🔍 on Twitter: “ssh tips… “
Via:
- [WayBack] Jeroen Pluimers auf Twitter: “Use the ssh-copy-id script (comes with ssh) or use trusted-key-exchange.sh (I wrote a rudimentary blog about it a long time ago at …, but probably better steps are available now).…”
- [WayBack] Jeff Atwood on Twitter: “how to get your key on a new machine is a big one. I recently did this and imported the key as root, which set the resulting folder permissions weird such that the imported key was THERE, but didn’t work.. much pulling of hair ensued…”
- [WayBack] Jeroen Pluimers on Twitter: “the virtues of a non-linear twitter “time”line: discovering you already finished <<the tips>> before I tweeted. Well done!…”
Some more tips:
- [WayBack] Kelly Campbell auf Twitter: “ssh-agent and ssh -A for forwarding your key to a machine you don’t want to copy your key to would be good to have in the tips too…”
- [WayBack] Idan Beck auf Twitter: “Also getting ssh-agent to load the key / passphrases. Gets me every time… “
- [WayBack] David Schenet a Twitter: “Tilde-period is a great tip. You can use this in nested ssh sessions too, like if you’re connecting from A to B to C. ~~~. would be the escape sequence to kill the connection from B to C.… https://t.co/jZ5Q2LBLJF”
- [WayBack] Dwayne Hart di Twitter: “When running commands with ssh. You should wrap them in double quotes so that they do not execute on your local system. Example, ssh remote “reboot” This ensures that the command is run only on the remote server.… https://t.co/uQjMb0KQ8S”
- [WayBack] Twitter पर John Erickson: “I missed your earlier all for suggestions, I really like -D to create a socks proxy on that egresses from the remote host. Super handy for quick http proxies.… https://t.co/Pao8LcqJQo”
- [WayBack] simon hengchen on Twitter: “I’m using ServerAliveInterval in the .ssh/config file: https://t.co/pkq9dni6eL… “
- [WayBack] ssh – What options `ServerAliveInterval` and `ClientAliveInterval` in sshd_config exactly do? – Unix & Linux Stack Exchange
- [WayBack] rektide de la fey on Twitter: “This is good. Still need something for handling changing networks. Couple years back I switched from autossh to systemd with infinite retries. Alas no backoff but works good. Not looking back to one-off process management software like autossh, f that.… https://t.co/N8oXcioVjn”
- [WayBack] Ryan Baumann on Twitter: “You can also use connection multiplexing with ControlPersist. Handy for scp with remote tab-complete on an existing ssh connection!… https://t.co/VQLQKC8iTn”
- [WayBack] cron mom on Twitter: “omg I didn’t know this yesterday but found it looking up a question with a friend and its really cool! madboa.com/blog/2017/11/02/ssh-proxyjump/ … “
- [WayBack] Using ProxyJump with SSH and SCP: no more
-D
The New Way
Sometimes, however, you may want to avoid the two-step process, or you may be on a host that doesn’t have all the tools you need for SOCKS connections.
The newÂ
-J
 (akaÂProxyJump
) command is tailor-made for you! Here’s the basic invocation:ssh -J your.jump.host remote.internal.host
You’ll end up logged into the remote internal host, and ssh automatically takes care of the intermediate step of logging into the jump host first.
You can even use it as an option for secure file copies:
scp -o 'ProxyJump your.jump.host' myfile.txt remote.internal.host:/my/dir
The fileÂ
myfile.txt
 will end up in theÂ/my/dir
 directory on your remote internal host.
- [WayBack] Using ProxyJump with SSH and SCP: no more
- [WayBack] Chris Armstrong auf Twitter: “OpenSSH has a (relatively recent) option called ProxyJump / -J that is super handy when you need to get through a VPN… “
–jeroen
Leave a Reply