Missing ssh keys?

Hello everyone.

I have to preface this with "I'm a fairly new Mac/Darwin user", but I have some experience in the linux OS.

Ok, I am trying to configure sshd on the mini to allow me to ssh into the system from work. I had assumed that checking the box on Sharing -> Remote Login would have configured the sshd to run, but that appears to not be the case. I performed google searches, apple support searches, lots and lots of searches, but cannot seem to get this issue ironed out.

If I try to just "ssh chuckpo@127.0.0.1" I get the connection refused message.

Today, I tried just executing /usr/sbin/sshd and the output is:

Could not load host key: /etc/ssh host_rsakey
Could not load host key: /etc/ssh host_dsakey

ssh-keygen did not seem to help in this case either, but it created something in my ~/.ssh/ directory, but it is not either of these.

I know this has to be something very basic that I am missing, and do not know where to look at this point. All of my old places are not here (inetd.conf, rc.d, and so on) and I am kind of lost.

Any help is greatly appreciated.

cp

Intel Mini, Mac OS X (10.5.6)

Posted on Dec 19, 2008 2:29 PM

Reply
3 replies

Jan 29, 2009 12:34 PM in response to chuckpo1

Chuckpo

I was also tried many times to get this to work.
Here is what I found out after you setup sharing with remote login.
I had to also run command "sudo touch /var/db/useLS"
then reboot machine.
I am at 10.5.6 my understanding is this allow sshd to become active when requests are made. It takes a reboot from what I read.
Also use ssh-keygen -d for all key types or pick the one you want I use RSA.
this created the .ssh directory in my home folder.

Jan 29, 2009 6:25 PM in response to chuckpo1

Unless something was changed as far as sshd configuration, what you are describing should work. Don't worry about the error messages you received when you tried to run sshd manually... this will happen when you try to run this without root privileges.

I would start it through system preferences and then see if port 22 is listening. It should be. When you try to ssh to the loopback addr, try it with "ssh -vvv chuckpo@127.0.0.1". This will turn the verbosity of the ssh client up to give as much troubleshooting info as you need. And if you are going to be opening it up to the internet to be able to hit it from work I would definitely study up on securing ssh. The default sshd config is not hardened enough to be used over untrusted networks.

Jan 29, 2009 7:38 PM in response to chuckpo1

I use DSA and ive never had problem. Ive always just started remote login from the sharing pref pane. and dded the key to ~/.ssh/authorized_keys. I dont generally have the software firewall enable though, but it should add the proper rule to allow a connection, at least from the local network.

Start it up with the pref pane then in terminal you can use <pre>launchctl list</pre> to make sure its running. If it is youll see the key com.openssh.sshd, if not then thats an issue.

BTW the command to start the daemon is <pre>sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist</pre> This is roughly analogous to <pre>sudo /etc/init.d/ssh start</pre>, except that the -w flag tells it to remove the disabled key and write modified pref back to disk, so its then always on even after restart unless unloaded (same command only using the unload subcommand instead).

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Missing ssh keys?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.