ssh – Tea-Driven Development https://blog.mattwynne.net Matt Wynne taking it one tea at a time Wed, 21 Aug 2019 13:02:06 +0000 en-US hourly 1 https://wordpress.org/?v=6.2 165828820 Pain-free and fun password-less SSH with ssh-forever https://blog.mattwynne.net/2009/08/16/pain-free-and-fun-password-less-ssh-with-ssh-forever/ https://blog.mattwynne.net/2009/08/16/pain-free-and-fun-password-less-ssh-with-ssh-forever/#comments Sun, 16 Aug 2009 00:51:20 +0000 http://blog.mattwynne.net/2009/08/16/pain-free-and-fun-password-less-ssh-with-ssh-forever/ Continue reading "Pain-free and fun password-less SSH with ssh-forever"

]]>
A while ago I wrote a tip that showed you how to copy your public SSH key to a remote server to allow you to login without entering a password every time. I’ve since put this into a script that I use, and today I got sick enough of copying that script onto yet another machine that I packaged it up as a gem, so now we can all use it.

It works just like the plain old ‘ssh’ command, but this time you’ll never have to enter your password again:

ssh-forever username@yourserver.com

Your key will be generated (if necessary), copied to your server, and you’ll be logged in as normal.

Installation

gem sources --add http://gemcutter.org
gem install ssh-forever

Example:

[matt@bowie ssh-forever (master)]$ ssh-forever mattwynne@mattwynne.net
You do not appear to have a public key. I expected to find one at /Users/matt/.ssh/id_rsa.pub
Would you like me to generate one? [Y/n]y
Copying your public key to the remote server. Prepare to enter your password for the last time.
mattwynne@mattwynne.net's password:
Success. From now on you can just use plain old 'ssh'. Logging you in...
Linux broncos 2.6.29-xeon-aufs2.29-ipv6-qos-grsec #1 SMP Thu Jul 9 16:42:58 PDT 2009 x86_64
  _
 | |__ _ _ ___ _ _  __ ___ ___
 | '_ \ '_/ _ \ ' \/ _/ _ (_-<
 |_.__/_| \___/_||_\__\___/__/

 Welcome to broncos.dreamhost.com

Any malicious and/or unauthorized activity is strictly forbidden.
All activity may be logged by DreamHost Web Hosting.

Last login: Sat Aug 15 17:24:17 2009
[broncos]$

Why?

Because I can never remember how to do it by hand. Now I don’t have to, and nor do you.

]]>
https://blog.mattwynne.net/2009/08/16/pain-free-and-fun-password-less-ssh-with-ssh-forever/feed/ 11 155
Quick and Easy Password-less SSH Login on Remote Servers https://blog.mattwynne.net/2009/01/13/quick-and-easy-password-less-ssh-login-on-remote-servers/ https://blog.mattwynne.net/2009/01/13/quick-and-easy-password-less-ssh-login-on-remote-servers/#comments Tue, 13 Jan 2009 17:34:27 +0000 http://blog.mattwynne.net/2009/01/13/quick-and-easy-password-less-ssh-login-on-remote-servers/ Continue reading "Quick and Easy Password-less SSH Login on Remote Servers"

]]>
Like so many posts in this category, this is surely child’s play to you linux aficionados. For those of us mere morals though, this is a very useful little trick, and it shows how you can easily move data from your local workstation to a remote server using SSH.

If you don’t already have a public / private key pair on your local workstation do this:

ssh-keygen -t rsa

If you have no idea what I’m talking about, try looking for this:

ls ~/.ssh

Did you see anything? You’re looking for a file called id_rsa.pub, I would guess.

Now that you have generated your key, to copy the public key part up to the remote server, do this:

ssh remote-user@remote-server.com “echo ‘cat ~/.ssh/id_rsa.pub‘ >> ~/.ssh/authorized_keys”

You should now be able to dance around the inner bits of the internet to your heart’s content.

Thanks to Dan Lucraft for the technology behind this post.

]]>
https://blog.mattwynne.net/2009/01/13/quick-and-easy-password-less-ssh-login-on-remote-servers/feed/ 1 95