LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-27-2011, 01:37 PM   #1
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
[current] openssh 5.7 - ECDSA as default algorithm


today I upgraded to openssh-5.7 in -current.
I started the daemon and I got a warning, but the daemon ran
Code:
# /etc/rc.d/rc.sshd start
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
# ps aux | grep sshd | grep -v grep
root      9834  0.0  0.0  27308  1180 ?        Ss   20:03   0:00 /usr/sbin/sshd
so I had a look at the release notes and discovered that ECDSA is the new preferred key algorithm when connecting to hosts (it's tried first if no host key is found in ~/.ssh/known_hosts).

so I decided to give it a shot

I added a section to /etc/rc.d/rc.sshd
Code:
--- rc.sshd.orig        2011-01-27 19:48:20.332999994 +0100
+++ rc.sshd     2011-01-27 19:47:26.365999972 +0100
@@ -12,6 +12,9 @@
   if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
     /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
   fi
+  if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then
+    /usr/bin/ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
+  fi
   /usr/sbin/sshd
 }
and
Code:
/etc/rc.d/rc.sshd restart
on my client, I removed the previous rsa key from my ~/.ssh/known_hosts file (because if ssh finds it, it doesn't try to fetch the ecdsa key), and connected to the new sshd
Code:
The authenticity of host '[henry.rollins.com]:4965 ([254.254.254.254]:4965)' can't be established.
ECDSA key fingerprint is 6f:b7:f0:46:c5:7b:fe:93:a8:95:bb:59:1c:2e:85:20.
Are you sure you want to continue connecting (yes/no)?
here is a short discussion on the topic: they suggest, like in the release notes, to collect the new host keys with ssh-keyscan, and this should avoid the need to edit the known_hosts file.

-WARNING-
the only problem is that while openssh people decided to set ECDSA as default I'm not really sure if it's considered mature enough by Pat and that can be the reason why it hasn't been added to the default config.
so try it at your own risk!

Last edited by ponce; 01-27-2011 at 02:39 PM.
 
Old 01-31-2011, 09:25 AM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Thanks Ponce, that's handy to know.
 
Old 01-31-2011, 09:34 AM   #3
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
it's already fixed in the latest -Current update
 
Old 02-11-2011, 12:49 AM   #4
samoak
LQ Newbie
 
Registered: Feb 2011
Posts: 1

Rep: Reputation: 0
Downloaded ssh sources: openssh-5.8p1.tar.gz

I did the following to get rid of the "said" error.

1> In file Makefile.in removed following 2 line conditional code and executed configure script.
==
if [ -z "@COMMENT_OUT_ECC@" ] ; then \
...
fi ; \
==

It gave me following:
==
if [ -f $(sysconfdir)/ssh_host_ecdsa_key ] ; then \
echo "$(sysconfdir)/ssh_host_ecdsa_key already exists, skipping." ; \
else \
./ssh-keygen -t ecdsa -f $(sysconfdir)/ssh_host_ecdsa_key -N "" ; \
fi ; \
==

2> Additionally, removed following line:
==
test -z "@COMMENT_OUT_ECC@" && ./ssh-keygen -t ecdsa -f $(DESTDIR)$(sysconfdir)/ssh_host_ecdsa_key -N ""
==

3> Executed configure script. It gave me a Makefile of my need with ecdsa enabled.

Unfortunately, I couldn't find any option in "configure" script to turn ON/OFF the ecdsa related changes in the Makefile. Please correct me if I failed to find such an option to "configure" script.

regards,
- sameer oak

Last edited by samoak; 02-14-2011 at 09:54 PM.
 
Old 02-11-2011, 01:05 AM   #5
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Original Poster
Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
sorry if I haven't explained it clearly, but there was no error: ECDSA has been chosen as default key exchange algorithm by the openssh people, is correctly enabled in their build script and building produces binaries with ECDSA support.

I think Pat opted to follow their choices for defaults because he just adapted the rc.sshd script in -current to generate the ECDSA key if it's missing.

If you don't want to use ECDSA for connections to your host, you simply have to avoid generating the related key (revert the rc.sshd changes above and, if already generated, delete the ECDSA key in /etc/ssh/).

Last edited by ponce; 02-11-2011 at 04:48 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ECDSA key generation shyko Slackware 1 01-28-2011 01:40 AM
OpenSSL DSA / ECDSA "EVP_VerifyFinal()" Spoofing Vulnerability win32sux Linux - Security 1 01-10-2009 04:56 PM
OpenSSH server - default options Ashkhan Linux - Software 6 03-24-2008 07:08 AM
Details about default web Browser & default Email client sudhasmyle Linux - Software 4 06-15-2006 11:45 AM
Default Drowser & Default E-mail Cli sudhasmyle Linux - Networking 1 11-20-2004 10:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration