Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > enabling sshd on MacOS X pb1

enabling sshd on MacOS X pb1
Thread Tools
Ambrosia - el Presidente
Join Date: Sep 2000
Location: Rochester, NY
Status: Offline
Reply With Quote
Sep 27, 2000, 01:00 PM
 
Apple has apparently seen the light and included sshd all set up and installed (1.x and 2.x) on MacOS X pb1. There's a SSH dir in /System/Library/StartupItems/, complete with the shell script to fire it up.

The only thing missing is that you must add the following to /etc/hostconfig

SSHSERVER=-YES-

(Apple's script checks this variable before launching sshd)

While this may seem obvious to someone with more experience with the way NeXT implements things, it wasn't to me -- hopefully this will save someone a bit of time.


------------------
Andrew Welch / el
Presidente / Ambrosia
Software, Inc.
Andrew Welch / el Presidente / Ambrosia Software, Inc.
     
eucci
Guest
Status:
Reply With Quote
Sep 28, 2000, 09:39 AM
 
ooo, thanks for pointing that out! i was just discussing this with a co-worker last night. Now all Apple needs to do is get rid of that Telnet button in the File Sharing control panel, and/or put the SSH knob in its place.
     
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Vienna, VA, USA
Status: Offline
Reply With Quote
Sep 28, 2000, 07:58 PM
 
I'm just getting started here with SSH, I'm going to read the man pages now, but figured ask anyways.

When I ran the SSH script included, it said
"error: Could not load DSA host key: /etc/ssh_host_dsa_key
Disabling protocol version 2".

Is there an easy way to remedy this?

Thanks...
_ _____________________________ _

Brian Heath
     
wyzeguy
Guest
Status:
Reply With Quote
Sep 28, 2000, 08:54 PM
 
change the /System/Library/StatupItems/SSH/SSH file so it looks like this:
#!/bin/sh

. /etc/rc.common

##
# Start up secure login server
##

if [ "${SSHSERVER:=-NO-}" = "-YES-" ]; then

ConsoleMessage "Starting Secure Login Server"

if [ ! -f /etc/ssh_host_dsa_key ]; then
echo "Generating ssh host key..."
ssh-keygen -d -b 1024 -f /etc/ssh_host_dsa_key -N "" -C "$(hostname)"
fi

sshd

fi

------------------
Life is what happens to you when you have something else planned. --Mark Roberts
     
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Crofton, MD, USA
Status: Offline
Reply With Quote
Sep 28, 2000, 10:23 PM
 
Thanks for the info. I have been messing with enabling ssh on and off all day. I am grateful for people smarter than myself
     
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Vienna, VA, USA
Status: Offline
Reply With Quote
Sep 29, 2000, 08:47 AM
 
Thanks for the help on the MacNN forum. I'm still having a little trouble getting my client terminal (SecureCRT 3.0.3 for Windows NT) to connect, but I'm still working on it. I think the client might be out of date. It has a connection option for SSH2, but when I try to connect, it says "Protocal version mismatch with SSH server. Servers version string was SSH-1.5-OPENSSH_2.1.1". I'm still working on it though.

Thanks again...
_ _____________________________ _

Brian Heath
     
Lunchbox
Guest
Status:
Reply With Quote
Sep 30, 2000, 12:03 PM
 
I may be completely off here, but doesn't SSH use ident?
     
Lunchbox
Guest
Status:
Reply With Quote
Sep 30, 2000, 12:05 PM
 
I may be completely off here, but doesn't SSH use ident?
     
nierman
Guest
Status:
Reply With Quote
Sep 30, 2000, 03:12 PM
 
I tried this and got the following error:

Starting Secure Login Server
Generating ssh host key...
Generating DSA parameter and key.
Your identification has been saved in /etc/ssh_host_dsa_key.
Your public key has been saved in /etc/ssh_host_dsa_key.pub.
The key fingerprint is:
f4:83:15:2c:5d:03:e8:79:f7:85:af:4f:50:40:7b:e3 manatee
error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@
error: @ WARNING: UNPROTECTED PRIVATE KEY FILE! @
error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@
error: Bad ownership or mode(0600) for '/etc/ssh_host_key'.
error: It is recommended that your private key files are NOT accessible by other
s.
error: Could not load host key: /etc/ssh_host_key: Undefined error: 0
Disabling protocol version 1

Originally posted by wyzeguy:
change the /System/Library/StatupItems/SSH/SSH file so it looks like this:
#!/bin/sh

. /etc/rc.common

##
# Start up secure login server
##

if [ "${SSHSERVER:=-NO-}" = "-YES-" ]; then

ConsoleMessage "Starting Secure Login Server"

if [ ! -f /etc/ssh_host_dsa_key ]; then
echo "Generating ssh host key..."
ssh-keygen -d -b 1024 -f /etc/ssh_host_dsa_key -N "" -C "$(hostname)"
fi

sshd

fi

     
Grizzled Veteran
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
Oct 1, 2000, 05:54 AM
 
wyzeguy,

Your /System/Library/StartupItems/SSH/SSH file only works if the user has failed by running the first version. A *complete* SSH file would generate both keys and spare users from any error messages in the first place.

Share and enjoy!

--- snip ---

#!/bin/sh

. /etc/rc.common

##
# Start up secure login server
##

if [ "${SSHSERVER:=-NO-}" = "-YES-" ]; then

ConsoleMessage "Starting Secure Login Server"

if [ ! -f /etc/ssh_host_key ]; then
echo "Generating ssh host key..."
ssh-keygen -f /etc/ssh_host_key -N "" -C "$(hostname)"
fi

if [ ! -f /etc/ssh_host_dsa_key ]; then
echo "Generating ssh host key..."
ssh-keygen -d -b 1024 -f /etc/ssh_host_dsa_key -N "" -C "$(hostname)"
fi

sshd

fi
Since EBCDIC
Using Macs since they were Lisas.
     
wyzeguy
Guest
Status:
Reply With Quote
Oct 1, 2000, 09:22 PM
 
Thanks for the fix. I never recieved that error but it's probably 'cause I ran it without modification first so the ssh_host_key was already there.

------------------
Life is what happens to you when you have something else planned. --Mark Roberts
     
Fresh-Faced Recruit
Join Date: Oct 2000
Location: Cologne, Germany
Status: Offline
Reply With Quote
Oct 2, 2000, 01:22 PM
 
nierman,

Apparently for some reason the key file was generated with too lax permissions.


try this:

su -

(Type your root pw when prompted)

l /etc/ssh_host_dsa_key

This should show you the key file. If it's there type:

chmod 0600 /etc/ssh_host_dsa_key

This will change permissions so only root can read the keyfile.

Then type:

sshd

This should start sshd.


If you did NOT find the keyfile type:

ssh-keygen -d -b 1024 -f /etc/ssh_host_dsa_key -N "" -C "<YOUR HOSTNAME HERE>"

(Including all quotes and replacing <YOUR HOSTNAME HERE> with your machine's name.)


After that you should be able to start sshd by typing:

sshd


Hope this works for you.

Jens

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/L dpu s:- a- C+++ UL P++ L++ E W+++ N+
o K- w-- O M++ V- PS++ PE- Y+ PGP t+ 5- X-
R tv+ b++ DI++ D++ G e+ h+ r++ y+
------END GEEK CODE BLOCK------

[This message has been edited by Baumi (edited 10-02-2000).]

[This message has been edited by Baumi (edited 10-02-2000).]
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/L dpu s:- a- C+++ UL P++ L++ E W+++ N+
o K- w-- O M++ V-
PS++ PE- Y+ PGP t+ 5- X-
R tv+ b++ DI++ D++ G e+ h+ r++ y+
------END GEEK CODE BLOCK------
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:09 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2