Re: Password less login between client & server, server & client



sky@xxxxxxxxxxxxxx wrote:
Hi,

I have a question pertaining to the possibility of using ssh keys for
password less logins on both the ssh client and ssh server. To explain
this more directly I want my ssh client to connect to my ssh server and
vice versa. Currently I have searched throughout the newsgroups and
performed many google queries but I cannot seem to find the solution.

I am using OpenSSH_3.0.2p1 on Solaris 8 Operating Systems on Sparc
architecture and various models.

To provide you with a little background I will explain the process I
use to create a key for the ssh client. On the ssh client I create my
public and private keys using the following steps:

1. Login as the user that is making the connection.
2. If not already created, mkdir .ssh in the user's home directory and
set restrictive permissions.
3. cd ~/.ssh
4. Execute: /usr/local/bin/ssh-keygen -t dsa
5. I accept the default key names, "id_dsa" and "id_dsa.pub" and hit
enter to accept a blank passphrase.
6. I then scp the "id_dsa.pub" to the servers .ssh directory and cat or
copy it to "authorized_keys". I set restrictive permissions, 400 to the
"authorized_keys" file.
7. From the client I then type: ssh server-name and am allowed to login
without a password.

To allow the server to connect to the client I perform the same
process, except rename the public and private keys to different names,
so that I do not overwrite the key information. I scp the
"id_dsa_server.pub" to the client and cat >> authorized_keys. This does
not work and when I attempt to login from the server to the client I am
then prompted for a password.


Currently, as a temporary work around I am using an rsa key to connect
from my client to server and a dsa key to connect from my server to
client. I would like to find a permanent solution to this problem, as I
have more clients that will need to connect to both the server and
client, and vice versa again.

Thank you in advance for any advice or help anyone can provide on this
topic.


You're making it more complicated than necessary. You don't need to
juggle files like this.

Servers only need the public key. Clients only need the private key.
Regardless of which server you're calling the client or server, as far
as ssh is concerned, the server is *always* the one running sshd, and
the client is *always* the one connecting to it with ssh, putty, or
whatever other client software you're using.

Here's all you need to do. Create one keypair. Copy the private key to
both servers' .ssh directory. Place the public key in both servers'
authorized_keys file. That should be all you need.

I would *strongly* recommend passphrase protecting your private key.
Anyone who gets a copy of that file can authenticate as you with no
password or passphrase on any server/account the corresponding public
key is installed on. If you need automatic authentication with no
keyboard intervention use an agent. With an agent you can enter your
passphrase once and have automatic authentication every time after that.
If your client is PuTTY use paegent. If OpenSSH, then ssh-agent and use
ssh-add to add/list identities (private keys) to/from it. The agent will
prompt one time for the passphrase and feed it to the client ever time
thereafter.
--
To reply by email remove "_nospam"
.



Relevant Pages

  • Re: Explanation of SSH
    ... I am still unclear on how SSH works exactly. ... Client issues SSH command and names server ... "Shopper" says "server sends back its public host and server keys ... Surely there is only one public key it sends ...
    (comp.security.ssh)
  • Re: ssh security question
    ... In my case - the client is a windows client and the ssh is embedded into the windows nx client. ... Is there any reason I can't run ssh-keygen on the server and copy the private key to the client - and the public key to the "authorised" directory? ... sniffer can catch your passwords, and it would make it trivial to log in ...
    (SSH)
  • Re: Publishing a SSH Server
    ... Your unix box cannot reply to SSH request, ... Create a client address set for your unix box (ip address from to are the ... Jim Harrison [ISA SE] ... In that case the server is a SecureNET client but still it doesn't work.... ...
    (microsoft.public.isa.publishing)
  • Re: FC6 VPN
    ... Then you can run any application you would like off the server by simply running it, or if you want to run a whole session, use gnomesession. ... ssh client that supports X forwarding, which is want you want to be looking at. ... SSH allows you to forward any local port to any remote port. ... If you need to connect to, say a windows share, you would forward your local port to the linux server through the ssh tunnel. ...
    (Fedora)
  • Re: What doesnt lend itself to OO?
    ... >> proxy and instructs the server to constuct the real object. ... rather than client code. ... If 'clock' is instantiated in the server, ... > for the server interface at the OOA level. ...
    (comp.object)