Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use pub keys (not ssh password) in ssh command?

1 view
Skip to first unread message

Peter Hanke

unread,
Oct 22, 2009, 5:52:02 AM10/22/09
to
Assume I want to open an SSH connection from Linux to a remote computer.

How can I use local pub/priv key files as parameters for authentication in this command?
Remote computer supports ssh key files.

Again: I do not want to use user/password for this but generated key files.

Peter

Fabian Schuh

unread,
Oct 22, 2009, 6:08:46 AM10/22/09
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter Hanke <pete...@andres.net> schrieb:


> Again: I do not want to use user/password for this but generated key files.

Google?
http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/internet/node31.html

- --
(`/\
`=\/\
`=\/\
`=\/
_\___ best regards
) ( -- Fabian Schuh
( INK )
\___/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkrgLy4ACgkQ8lOKSygtYjgSvwCgxnvQUtC54ULiWmXW5/V5pVQ2
xdMAn2/ujVCV+QMnqN2e8iGyuvI+OVug
=4u1G
-----END PGP SIGNATURE-----

Grant

unread,
Oct 22, 2009, 6:40:17 AM10/22/09
to

You need to transfer the public key to the remote computer, either
via a 'normal' user/password login or some other transfer method.

See: 'man ssh-copy-id'

Grant.
--
http://bugsplatter.id.au

Alexander Gran

unread,
Oct 22, 2009, 7:06:34 AM10/22/09
to
Peter Hanke wrote:

> How can I use local pub/priv key files as parameters for authentication in
> this command? Remote computer supports ssh key files.

man ssh:
-i identity_file
Selects a file from which the identity (private key) for RSA or DSA
authentication is read. The default is ~/.ssh/identity for protocol
version 1, and ~/.ssh/id_rsa and ~/.ssh/id_dsa for protocol version 2.
Identity files may also be specified on a per-host basis in the
configuration file. It is possible to have multiple -i options (and
multiple identities specified in configuration files).

i.e. ssh -i /home/joe/private_foo/ssh_id_special ro...@host.com

regards
Alex

Maxwell Lol

unread,
Oct 22, 2009, 7:15:56 AM10/22/09
to
pete...@andres.net (Peter Hanke) writes:

(1) generate a keypair using ssh-keygen
(2) copy the *.pub file to the remote computer
(3) append this file to the ~/.ssh/authorized_keys (or authorized_keys2) file

Chris F.A. Johnson

unread,
Oct 22, 2009, 10:29:06 AM10/22/09
to

man ssh-keygen


--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence

Jon Solberg

unread,
Oct 22, 2009, 2:06:14 PM10/22/09
to

man ssh

--
Jon Solberg (remove "nospam." from email address).

0 new messages