3 ms·
I have been looking for solutions to some of these things forever: 21) Have an ssh session open forever autossh -M50000 -t server.example.com ‘screen -raAd my
by ljlolel 16y ago
I have been looking for solutions to some of these things forever:
21) Have an ssh session open forever
autossh -M50000 -t server.example.com ‘screen -raAd mysession’
Open a ssh session opened forever, great on laptops losing Internet connectivity when switching WIFI spots.
24) Transfer SSH public key to another machine in one step
ssh-keygen; ssh-copy-id user@host; ssh user@host
This command sequence allows simple setup of (gasp!) password-less SSH logins. Be careful, as if you already have an SSH keypair in your ~/.ssh directory on the local machine, there is a possibility ssh-keygen may overwrite them. ssh-copy-id copies the public key to the remote host and appends it to the remote account’s ~/.ssh/authorized_keys file. When trying ssh, if you used no passphrase for your key, the remote shell appears soon after invoking ssh user@host.
25) Copy stdin to your X11 buffer
ssh user@host cat /path/to/some/file | xclip
- wladimir 16y agoVery useful indeed, some of those I've been wondering about for ages.
- danielh 16y ago25a) Copy stdin to clipboard on Mac ssh user@host cat /path/to/some/file | pbcopy
- xtacy 16y agoTo keep an ssh session forever, you could also add the following line to ssh_config. ServerAliveInterval 10 The client sends a keepalive packet every 10 seconds.