TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

SSH Cheat Sheet

80 pointsby marcobehleralmost 3 years ago

9 comments

thedougdalmost 3 years ago
Favorites for scripting including the ability to run any command or script on the remote.<p><pre><code> ssh remotehost reboot </code></pre> Heredoc syntax also works:<p><pre><code> ssh remotehost &lt;&lt;&#x27;EOF&#x27; ls cat &#x2F;etc&#x2F;passwd reboot EOF</code></pre>
rollulusalmost 3 years ago
My favorite Konami code level of cheat: ssh escape sequences. On a new line: ~. to terminate a connection that’s stuck. Or ~? for more help.
评论 #32025915 未加载
评论 #32025587 未加载
评论 #32025588 未加载
评论 #32026141 未加载
acattonalmost 3 years ago
PSA: scp is deprecated.[1] Please use sftp.[2]<p>[1] <a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;835962&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;835962&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;man.openbsd.org&#x2F;sftp.1" rel="nofollow">https:&#x2F;&#x2F;man.openbsd.org&#x2F;sftp.1</a>
评论 #32028440 未加载
评论 #32026328 未加载
评论 #32027296 未加载
评论 #32026913 未加载
评论 #32026131 未加载
peppermint_teaalmost 3 years ago
a few more examples on ssh tunnels : <a href="https:&#x2F;&#x2F;cloudbase.200013.net&#x2F;doc&#x2F;linux&#x2F;ssh&#x2F;ssh_tunelling.html" rel="nofollow">https:&#x2F;&#x2F;cloudbase.200013.net&#x2F;doc&#x2F;linux&#x2F;ssh&#x2F;ssh_tunelling.htm...</a>
评论 #32025873 未加载
kaliszadalmost 3 years ago
I like how this guide also takes Windows into account, it has some unique challenges.<p>I have written some notes especially on SSHFS (also for Windows!) and tunnels with SSH (e.g. SOCKS proxy) as an OrgPage: <a href="https:&#x2F;&#x2F;www.orgpad.com&#x2F;s&#x2F;wRIx3rNLZ6y" rel="nofollow">https:&#x2F;&#x2F;www.orgpad.com&#x2F;s&#x2F;wRIx3rNLZ6y</a> These tricks saved my bacon so many times already. Most of it can be used with the FUDO PAM jump host appliance (<a href="https:&#x2F;&#x2F;fudosecurity.com&#x2F;fudo-pam&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fudosecurity.com&#x2F;fudo-pam&#x2F;</a>) that is based on FreeBSD and one of the developers spoke about it and other things on <a href="https:&#x2F;&#x2F;www.bsdnow.tv&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.bsdnow.tv&#x2F;</a> I think. Some of it works with OpenWRT&#x27;s Dropbear nicely as well.
qwertoxalmost 3 years ago
I also find `ssh-copy-id` useful.
Davieyalmost 3 years ago
I like the idea for multiple Github accounts, but I have concerns over the suggestion:<p>``` Host github-work.com .. Host github-personal.com ```<p>Getting in the habit of using a fake FQDN (which right now aren&#x27;t registered) feels pretty risky.
评论 #32026532 未加载
dandanuaalmost 3 years ago
The most annoying &quot;feature&quot; of ssh for me is the discrepancy between public keys presentations. How I suppose to verify fingerprint of a new server if it uses a different presentation in the keys file?
LeoPantheraalmost 3 years ago
&gt; ssh-keygen -t rsa -b 4096 -C &quot;your@email.com&quot;<p>Is there any evidence that 2048 bit RSA keys are insufficient?<p>4096 bit keys are absolutely huge. I don&#x27;t know if working with them is also slower, but I would guess so.