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 login without password (authorized_keys)

17 pointsby nocivusalmost 16 years ago

8 comments

naileralmost 16 years ago
This article is somewhat out of date. Modern OpenSSH distro's include 'ssh-copy-id', a single command to transfer, and append one's key to the remote list ofauthenores keys.<p>So:<p>Step 1:<p><pre><code> ssh-genkey </code></pre> Step 2:<p><pre><code> ssh-copy-id user@host </code></pre> Done.
评论 #732077 未加载
评论 #732214 未加载
评论 #732224 未加载
评论 #732313 未加载
评论 #732443 未加载
评论 #732242 未加载
surkialmost 16 years ago
Some more SSH tips<p>1. Use SSH connection multiplexing<p>If you are connecting to same computer multiple times, this saves up quite a bit of time <a href="http://www.revsys.com/writings/quicktips/ssh-faster-connections.html" rel="nofollow">http://www.revsys.com/writings/quicktips/ssh-faster-connecti...</a><p>2. Use autossh<p>For a persistent ssh connection (ex. for reverse tunnels) <a href="http://www.debianadmin.com/autossh-automatically-restart-ssh-sessions-and-tunnels.html" rel="nofollow">http://www.debianadmin.com/autossh-automatically-restart-ssh...</a>
Erwinalmost 16 years ago
1) You should definitely create a passphrase for your private key (you should only be asked to unlock it once due to ssh-agent). Otherwise if someone gets hold of your private key they can login to any machine you have set up an authorized_keys entry on.<p>2) use ssh-copy-id to install your public key on a remote (and fix up the permissions on ~/.ssh etc. which for me is the #1 case of key based login not working).
评论 #732186 未加载
评论 #732254 未加载
bclalmost 16 years ago
He also flubbed using ssh-agent. Usually it is run from the login script once. You then do a ssh-add to add your identity to it. Once that is done you don't need to enter your password for that session anymore. You can even allow ssh on other systems to access your agent so you can ssh to another machine, ssh from that machine to a 3rd which will use your agent for the key info.<p>Never leave your key without a passphrase!<p>A good series of articles on ssh bt Brian Hatch can be found here - <a href="http://www.hackinglinuxexposed.com/articles/20021211.html" rel="nofollow">http://www.hackinglinuxexposed.com/articles/20021211.html</a>
ovi256almost 16 years ago
I connect to remote machines several times in a typical workday, and this helps to save a bit of time. Furthermore, it allows some non-obvious behaviour, like closing the connection as soon as I did what I wanted. This avoids leaving a ssh session open in which you may erroneusly type a command intended for your local machine. An "svn up" on the wrong machine car ruin your day.
Tichyalmost 16 years ago
Isn't that a bit of a security issue? One machine in the network hacked, they are all gone? Then again, hacker's could just install keyloggers if they get hold of one machine. But it would be a bit more effort.
评论 #732109 未加载
antipaxalmost 16 years ago
Obscuring his public key tells me this guy doesn't quite understand what the point of public-private key encryption is.
评论 #732244 未加载
nocivusalmost 16 years ago
Thanks for all the tips, everyone :D