Re: [SLUG] automating bash password entry

From: Mike Branda (mike@wackyworld.tv)
Date: Thu Apr 22 2004 - 18:47:56 EDT


Ian and all, I will try the ssh key thing and get back with you. I'm
assuming the first part of this below is taking place on the ssh client
on my box.

Kwan, what part do you want to know?? what we're doing or what we're
using to get it done?? :^)

thanks for the start, I'll let you know how it goes. Mike

On Thu, 2004-04-22 at 17:13, Ian Blenke wrote:
> Austin Theen wrote:
> > I suppose one of the craftier linux dieties will chime in about how you
> > can do this in a 3 line perl script.
>
> adminbox$ cd ~/.ssh
> adminbox$ ssh-keygen -t dsa -b 1024 -P '' -f id_dsa
> adminbox$ scp id_dsa.pub root@userbox:.ssh/authorized_keys
>
> The scp will ask for your password. From now on, from that user on
> adminbox, you can ssh into userbox as root without a password using ssh
> key trust.
>
> adminbox$ ssh root@userbox
> userbox#
>
> You may add multiple keys to a remote box merely by cat'ing them to the
> end of authorized_keys:
>
> mybox$ ssh-keygen -t dsa -b 1024 -P 'mypassword' -f id_dsa
> mybox$ cat id_dsa.pub | \
> ssh root@userbox 'cat - >> ~/.ssh/authorized_keys'
> mybox$ eval `ssh-agent`
> mybox$ ssh-add ~/.ssh/id_dsa
> Password: {mypassword}
> mybox$ ssh root@userbox
> userbox#
>
> Now both your user on adminbox, and my user on mybox can ssh in as root
> to userbox. My ssh key is protected with a passphrase of "mypassword",
> which I allow ssh-agent to unlock so that I won't need to enter a
> password to use my key when connecting to userbox.
>
> I don't recommend leaving passphraseless SSH keys laying around - but
> ssh-agent/ssh-add is something most newbies don't seem to grasp right away.

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:42:09 EDT