linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Samuel <samuel@bcgreen.com>
To: DerPuh <Puhbaer01@gmx.de>, linux-admin@vger.kernel.org
Subject: Re: ssh auto-login-script
Date: Tue, 07 Sep 2004 11:33:20 -0700	[thread overview]
Message-ID: <413DFEF0.6040207@bcgreen.com> (raw)
In-Reply-To: <413F4A9A.90800@gmx.de>

You're probably far better off to use ssh-keygen and public key
authentication...

The quickie method:

ssh-keygen -f qlogin -t rsa

When it asks for a password, just hit enter twice.
This creates a passwordless private key file.

There will be two files:  qlogin and qlogin.pub

qlogin.pub is the public key. copy it to the destination
box, and add it to the appropriate user's .ssh/authorized_keys2
file.   It doesn't need MUCH protection, unless you have enemies
in the NSA. Nontheless, it is prudent to make it readable only
by the owner.

At this point, you can simply go:

ssh -i qlogin user@remotebox

In this case the contents of the qlogin file is (effectively)
your pasword, and should only be readable by yourself (mode 400)

On the destination end, you can also modify the key to limit what
you can do with it -- most notably, you can limit it so that you
can only run a specific command:

if the original key looks like:
ssh-rsa AAAAB3NzaC1yc......HzoU= samuel@source.com
      (I deleted most of the key and replaced with .....)

then prepend the following:
command="/home/me/bin/dothis"  ssh-rsa AAAAB3NzaC1yc......HzoU= samuel@source.com

At that point, anybody who gets hold of the key will ONLY beable to run
the /home/me/bin/dothis program (no matter what they put on the ssh
comand line).  You might also want to turn things like port forwarding
off.

DerPuh wrote:
> Hi everybody!
> 
> I have to find a possibility to send a password directly to the ssh 
> password-prompt with a shell-script...
> 
> i tried to send it by pipe but it is blocked by the client...
> 
> does anyone have an idea if it is possible and if it is, how it works?
> 
> thx, DerPuh


-- 
Stephen Samuel +1(604)876-0426                samuel@bcgreen.com
		   http://www.bcgreen.com/~samuel/
    Powerful committed communication. Transformation touching
      the jewel within each person and bringing it to light.

  parent reply	other threads:[~2004-09-07 18:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-06 18:11 ssh auto-login-script DerPuh
2004-09-06 18:29 ` Matt Hemingway
2004-09-07 18:33 ` Stephen Samuel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-09-07 23:28 DerPuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=413DFEF0.6040207@bcgreen.com \
    --to=samuel@bcgreen.com \
    --cc=Puhbaer01@gmx.de \
    --cc=linux-admin@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).