Solved

Openssh : keys generated on ssh server or ssh client

Posted on 2011-03-08
8
705 Views
Last Modified: 2012-06-22

Q1 : basic question:
I have a Windows 2003 running Openssh server & a Linux box (ssh client).
The Linux box is the one that initiate sftp/ssh/scp connection to the Windows
box.  I would like to use key authentication, so are the private+public keys
generated (ie ssh-key-gen) on Windows 2003 or on the Linux box?

Q2:
If the keys are generated on the Windows 2003 Openssh (Ver 3.8p1-1), can
 someone provide the steps to generate the keys & how should the key be
added/processed on the Linux box to enable the Linux box to ssh into the
Windows 2003  box using the keys (ie no password needed)

Q3:
If the keys are generated on the Linux box (RHES 4.5), what's the command
to generate the keys & how should the keys be added/installed on the
Win 2003 box so that the Linux (ssh client) can ssh into the Windows box
without password (ie keys authentication
0
Comment
Question by:sunhux
  • 4
  • 2
  • 2
8 Comments
 

Author Comment

by:sunhux
Comment Utility

I got a feeling that the ssh keys should be generated on the ssh client
(ie the Linux box in my case) & the public key is then sent to the Win2003
Openssh server.

suppose I have a login id on the Openssh Win2003 server, is
the following steps correct to install the public key into the Openssh
Win2003 server?

$ mkdir -p ~/.ssh If it doesn’t already exist
$ chmod 700 ~/.ssh
$ cd ~/.ssh
$ ssh-keygen -t rsa
$ cat ~/.ssh/id_rsa.pub | ssh remote_loginid@sshserver_hostname ‘mkdir .ssh; chmod 700 .ssh; cat>>.ssh/authorized_keys’
0
 
LVL 27

Accepted Solution

by:
Nopius earned 167 total points
Comment Utility
> I got a feeling that the ssh keys should be generated on the ssh client
(ie the Linux box in my case) & the public key is then sent to the Win2003
Openssh server.

Yes.

> is the following steps correct to install the public key into the Openssh
Win2003 server?

No. Read here http://www.cs.bham.ac.uk/~smp/projects/ssh-windows/
Scroll down to 'To enable public key authentication for users other than Administrator:'.

Regards,
Srty
0
 
LVL 27

Expert Comment

by:Nopius
Comment Utility
Public key you can get from Linux after generation.
0
 
LVL 39

Assisted Solution

by:noci
noci earned 333 total points
Comment Utility
Technically it doesn't matter where you generate the key (best is on a machine with a good random numbers generator), it can even be a 3rd system not used in the communication between client and server.

Then you keep the private key for your self and have the public key installed on every system where you need it.

But...
You must be able to totally trust or control the system where you generate a key. (if you need it you can have multiple private/public key pairs for different purposes.., the key to be used can be specified by default it is id_dsa/id_rsa ...)
If you cannot trust those systems then don't generate a key there. Also keep in mind that the file storage that is temporarily used isn't wiped after use if you just remove the files.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:sunhux
Comment Utility

Thanks chaps.


2 more clarifications:

a) if my Linux ssh client has multiple (8 to be precise) Unix accounts that need to ssh into
    the  Win2003 Openssh server (all 8 use a common login id on Win2003 to ssh/scp), do
    I need to generate 8 pairs of keys using each of the 8 Unix accounts or I can just use
    root on my Linux box to generate 1 pair & then distribute the keys to the $HOME/.ssh
    directories of each of the 8 Unix accounts & to $HOME/.ssh of the Win2003 id ?

b)when doing ssh-keygen on Linux, should I use dsa or rsa?  Rather which is more
   secure of the two?
0
 

Author Comment

by:sunhux
Comment Utility


For question (b) above, which of the two ( rsa & dsa ) are supported by OpenSsh
  in Windows 2003?
0
 
LVL 39

Assisted Solution

by:noci
noci earned 333 total points
Comment Utility
a) yes, the certificates are assumed to be personal.
You can off-course distribute the same private key to all people, but if you need to revoke ONE, you need to issue all others a new key...
and you need to add all public keys to the ~/.ssh/authorized_keys or ~/.ssh/authorized_keys2  files.

b) dsa is a more recent version and may be assumed more future proof.
At lease ensure that everything is SSH V2... (dont mix ssh1 rsa keys  with ssh2...  dsa slightly preferred, rsa1 definitely forbidden.).
I am not sure what you mean by openssh in windows (most probably the cygwin one, and yes they should be supported).

Also configure the sshv1 to be forbidden.
0
 

Author Closing Comment

by:sunhux
Comment Utility
ok
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Secure Shell (SSH) is a network protocol for secure data communication, mainly used to administer remote Unix / Linux servers via command line. But it also allows the user to open a secure tunnel between a client and a server where he can send any k…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now