1820657 Members
2294 Online
109626 Solutions
New Discussion юеВ

Re: /dev/random & SSH

 
SOLVED
Go to solution
Chris Wong
Trusted Contributor

/dev/random & SSH

Hi,
I've written up a short paper on using /dev/random with SSH. (Installing, performance & security). I'm interested in feedback regarding the article and especially any experiences other have had in using /dev/random in a production environment (with or without SSH).

http://newfdawg.com/SSHpart5.htm

TIA.
- Chris
26 REPLIES 26
H.Merijn Brand (procura
Honored Contributor

Re: /dev/random & SSH

This is exactly what we are looking for, BUT


It's for 11i only, and we need it for 11.00. Do you have solutions for 11.00 too? Please?

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Chris Wong
Trusted Contributor

Re: /dev/random & SSH

Maybe someone from HP can answer the question if/when /dev/random will be available for 11.0.

Otherwise... I'd say update-ux. :->

- Chris
H.Merijn Brand (procura
Honored Contributor

Re: /dev/random & SSH

*we* could, but *our customers* can't. They will have to use it too. :/

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Jdamian
Respected Contributor

Re: /dev/random & SSH

I'm an HP-UX 11.00 administrator and I'm interested in getting /dev/random on my boxes.

I think HP is very dark in this kind of issues. I also think HP is slow for implementing easy solutions available yes in other Unix environments (as Linux). For instance, it is possible create /dev/zero in HP-UX 11.00 but I cannot find any man page where it is described.

Other issue may be internet security... HP startet support for OpenSSH but HP doesn't support PGP (other interesting security product)
doug hosking
Esteemed Contributor
Solution

Re: /dev/random & SSH

Sorry, but there are currently no plans to support /dev/random on 11.00.

As for /dev/zero, HP-UX 11.22 a.k.a 11i V1.6 does formally document /dev/zero at last.

Roger Crettol
Advisor

Re: /dev/random & SSH

Damian,

I can't remember where I picked this up, but
making /dev/zero goes like this :

------------------------------
#!/bin/sh

# major/minor for HPUX 11.X
mknod /dev/zero c 3 4
chown bin:bin /dev/zero
chmod 666 /dev/zero
-------------------------------

Though I don't know what the results of writing to /dev/zero might be ... reading
from it works fine.

-rg-
Berlene Herren
Honored Contributor

Re: /dev/random & SSH

We do have it here for 11i, I do not know if it will work for 11.0

http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=KRNG11I

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
doug hosking
Esteemed Contributor

Re: /dev/random & SSH

Berlene, as released it will NOT work on 11.00. This has heavy dependencies on kernel internals and specific kernel patches that vary from release to release. The primary author of the code in question sat directly across the hall from me. Trust me. :-)
Berlene Herren
Honored Contributor

Re: /dev/random & SSH

Thanks, Doug, glad you said that. But it is there for 11i, and does not come with the native OS.

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
doug hosking
Esteemed Contributor

Re: /dev/random & SSH

Sorry, I didn't mean to suggest it could never work on 11.00 with enough effort; just that the currently released bits don't work on 11.00 and that there are currently no plans to backport the code to 11.00.
P.H. Vogt
Advisor

Re: /dev/random & SSH


Thanks for the install howto, but it seems not to describe the current KRNG11i package.

swlist shows
KRNG11i B.11.11.06 HP-UX 11.11 Strong Random Number Generator

However, no /dev/random or /dev/urandom

a lsdev -e 57 shows

Character Block Driver Class
57 1 dmp vxvm

Also no startup scripts in the package. Any idea how to get the /dev/random devices?
man man
H.Merijn Brand (procura
Honored Contributor

Re: /dev/random & SSH

We've just installed egd.pl on 11.00, and with little changes to the software, that almost works as /dev/random

http://sourceforge.net/projects/egd/

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Mr Gorski
New Member

Re: /dev/random & SSH

Is it possible to force OpenSSH binary distribution from software.hp.com to use /dev/random ?

Michal
Tim Maletic
Valued Contributor

Re: /dev/random & SSH

Chris: your paper looks great, but what I still don't understand is the exact relationship between openssh, openssl, and the entropy source.

Your paper says: "For HP-SSH to utilize the new RNG no configuration changes need to be made to SSH." That doesn't sound right to me. Openssh's configure script attempts to find your entropy sources, and if it cannot find one, it uses its own fallback internal source. Getting openssh to recognize a new source of entropy, like a newly created /dev/urandom, will require a rebuild, unless I'm missing something.

[...tim spends hour playing with this stuff...]

OK, here's what I think happens. Openssl will detect and use a newly created /dev/[u]random at run time, even if that entropy source didn't exist at build time. But Openssh decides whether or not to use its internal entropy source at build time.

So for example, I had PRNGD running when I built openssl (0.9.6g), and then openssh (3.5p1). Now I stop prngd, and remove its socket. Openssh now stops functioning (i.e., the client dies with "Entropy collection failed" message). I then create HP's new /dev/[u]random devices, and -- whamo! -- openssh starts working again.

I suspect this is because openssh was built to use openssl's entropy, and openssl is smart enough to find the new device at run time. But if openssh was built to use its own entropy source, it will never find /dev/[u]random without a rebuild.

So the question for HP is, what entropy source does HP's SSH product use? My guess is that they'll have to ship a new product to make use of the new /dev/[u]random devices.

-Tim
Jeff Schussele
Honored Contributor

Re: /dev/random & SSH

Hi Tim,

By default, I believe HP uses the ~openssh2/etc/ssh_prng_cmds file for it's source.
It's just a list of commands and bit rates to generate the entropy.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Chris Wong
Trusted Contributor

Re: /dev/random & SSH

Once you install /dev/random, HP-SSH will start using it without making any changes. Check to make sure it is loaded:

# kmadmin -s
Name ID Status Type
=====================================================
krm 1 LOADED WSIO
rng 2 LOADED WSIO
#
If it's not loading, check /etc/rc.config.d/kminit and SAM/Kernel/Drivers and make sure rng is listed as a loadable module.
Jeff Schussele
Honored Contributor

Re: /dev/random & SSH

It should be noted that /dev/random is ONLY supported on 11i & higher.
It's not supported on 11.0 & lower.

My $0.02,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Chris Vail
Honored Contributor

Re: /dev/random & SSH

That link is dead to me, but I'd like to read your paper. Can you email it to me: cvail "at" ercot dot com?


Thanks,
Chris
Chris Wong
Trusted Contributor

Re: /dev/random & SSH

Tim,
I think you can figure out the entropy issue by looking at the files in:

/opt/ssh/src/ssh

According to the SSH O'Reilly book: SSH1 and SSH2 use a kernel-based randomness source if it is available, etc....

I think you only need to recompile if you wanted to use an add-on "randomness source", such as EGD, which is what you would need to do with 11.0.

- Chris
Steven E. Protter
Exalted Contributor

Re: /dev/random & SSH

I think its a very informative and useful paper and I may try it on my sandbox system.

With regards to commentary about HP being slow to adopt certain technologies and Linux being faster....

HP really isn't that slow but there is a reason that the most reliable form of Unix is HP-UX and not any Linux distribution. HP's caution is one of them.

I will add that I'm quite annoyed at how slow key transfer is with ssh, but I'm willing to tolerate it to maintain my support agreement.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Tim Maletic
Valued Contributor

Re: /dev/random & SSH

Ok, Chris, it looks like you're right. Tusc shows that HP's ssh tries to read /dev/urandom every time it's run, regardless of whether or not the device exists.

Looks like openssh always looks at /dev/urandom, no matter how it is compiled. I couldn't figure this out from the sources, but I rebuilt openssh to use the ssh-rand-helper and it still tries to read /dev/urandom.

My speculations about how openssl fits into this may be a red herring. I don't know.

I'd like a definitive answer, or at least a diagnotic procedure to determine which entropy source your ssh is using. I guess it's back to more heavy grepping in the openssh sources...
wenny harris
New Member

Re: /dev/random & SSH

 
Chris Wong
Trusted Contributor

Re: /dev/random & SSH

Hi,

Why did you "rm -r .ssh"?

The only file that can be removed when adding the /dev/random is the prng_seed file.

"The prng_seed files can be removed (this
includes the one in root???s .ssh directory) since the new device driver (accessed via /dev/random and /dev/urandom) does not need this seed file to create a random
number. "

Hope this helps.

- Chris
H.Merijn Brand (procura
Honored Contributor

Re: /dev/random & SSH

OK, the original thread is rather old, but I stumbled onto this:

--8<---
Subject: /dev/random for HP-UX 11.00 0.0.3 - A /dev/random device for HP-UX 11.00 (DLKM).
From: hpux11-random@freshmeat.net
Date: Mon, 15 Dec 2003 10:00:11 +0000 (UTC)
Newsgroups: fm.announce

/dev/random for HP-UX 11.00 0.0.3
by Jos Visser (http://freshmeat.net/~josv/)
Monday, December 15th 2003 02:00

About:
/dev/random for HP-UX 11.00 provides a device driver that generates
high-quality random numbers.

Changes:
This version resolves a race condition, which could lead to a kernel panic.

Release focus: Major bugfixes
License: GNU General Public License (GPL)
Project URL: http://freshmeat.net/projects/hpux11-random/

Homepage: http://freshmeat.net/redir/hpux11-random/43684/url_homepage/hpux11-random
Tar/GZ: http://freshmeat.net/redir/hpux11-random/43684/url_tgz/hpux11-random-current.tar.gz
Tar/BZ2: http://freshmeat.net/redir/hpux11-random/43684/url_bz2/hpux11-random-0.0.3.tar.gz
-->8---

And I wondered if people alsready used/tested it, and what HP's view about it is.

Home URL: http://www.josvisser.nl/hpux11-random/

And it WORKS!

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn