Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an iMac that I can access only in single user mode, because of serious hardware damage. I attached to it another computer with an Ethernet cable. I would like to login remotely to the iMac through SSH. The iMac is running OS X 10.6.4.

I came across similar answers but what I tried always failed.

I tried systemsetup -setremotelogin on and it returns the following error message:

systemsetup[63:903] setInetDServiceEnabled failed for ssh because authorizationRef is NULL!

While launchctl load -w /System/Library/LaunchDaemons/ssh.plist gives:

DNSServiceRegister("ssh"): -65563
DNSServiceRegister("sftp-ssh"): -65563
bind(): Can't assign requested address
launch_msg(): Socket is not connected
launchctl: CFURLWriteDataAndPropertiesToResource(/var/db/launchd.db/com.apple.launchd/overrides.plist) failed: -10

What should I do?

share|improve this question
    
Can't assign requested address sounds to me like it doesn't have any kind of network connection. I think in single-user mode you'd have to use ifconfig or ifup to turn enable networking. –  Blacklight Shining Jul 9 '12 at 10:17
    
@BlacklightShining thanks! I have little experience with these commands, I guess that with a Mac it would be more appropriate to use networksetup or ipconfig, however. Do you have an idea about what commands I should give in order for another computer to connect to the iMac via a single Ethernet cable? Or, in alternative, to connect the iMac to a wi-fi network protected with WPA2? –  Ralphtor Jul 9 '12 at 11:44
    
I'm not sure myself. You can get the manual page for almost any program with man $program_name, by the way. I'll take a look and see if I can come up with something for you to try… –  Blacklight Shining Jul 10 '12 at 11:57

2 Answers 2

Looks like you need to load some more plists:

launchctl load /System/Library/LaunchDaemons/com.apple.kextd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.notifyd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.configd.plist
launchctl load /System/Library/LaunchDaemon/com.apple.DirectoryServices.plist

Then do what you tried before:

launchctl load -w /System/Library/LaunchDaemons/ssh.plist
systemsetup -setremotelogin on

After that, I think you can simply plug the Ethernet cable into both computers to create an ad-hoc network. ifconfig en0 | grep inet on the target machine should get you its IP address, and then you're all set. :)

share|improve this answer
    
Thanks for your advice, the first commands were good. Unfortunately to the last command the computer answered with: DNSServiceRegister("ssh"): -65563, DNSServiceRegister("sftp-ssh"): -65563, with these two messages repeated twice. So I cannot connect with ssh. I remember vaguely to have changed the port for the incoming ssh connections, so it is probably my fault, but I would appreciate any help –  Ralphtor Jul 10 '12 at 15:18
    
I must clarify: launchctl load -w /System/Library/LaunchDaemons/ssh.plistgives me the error I mentioned in the previous comment, while systemsetup -setremotelogin onkeeps giving setInetDServiceEnabled failed for ssh because authorizationRef is NULL! –  Ralphtor Jul 10 '12 at 17:08
    
Do you remember how you changed the port? Could you maybe change it back? That might not do anything, but it's worth a try… –  Blacklight Shining Jul 10 '12 at 21:09
    
I read the configuration files, it seems that the port is correctly set to 21. Probably this was not the problem because I followed the instructions for another Mac and ssh gave the same errors. For honesty sake the Mac I tested was a Mac mini with Lion and it complained that com.apple.DirectoryServices.plist does not exist any more (as it was removed in Lion), but that should not be a big issue because ssh gave me exactly the same error as in the iMac. –  Ralphtor Jul 11 '12 at 18:38

Why not launching sshd directly? Once the network is up /usr/sbin/sshd -p 4212 will open a ssh server on port 4212.

share|improve this answer
    
Thanks for your answer. I executed the command (out of curiosity I'd like to ask why it was needed to write the complete path /usr/sbin/). If i run top on the iMac I see a process called sshd, so it should have worked. However when I connect with a computer with an Ethernet cable, look for the IP of the iMac with ifconfig, and run ssh 192.168.0.3 -p 4212 on the other computer it says ssh: connect to host 192.168.0.3 port 4212: Operation timed out –  Ralphtor Jul 19 '12 at 22:33
    
I should also mention that shutdown -h now now does not work to shut down the iMac. I had to shut it down manually –  Ralphtor Jul 19 '12 at 22:36
    
I tend to write full paths in my answers to avoid surprises due to badly configured PATH variables. I use that command often and it works for me, on 10.6 and 10.7, although not in single user mode I have to admit. Are you connecting in ssh as root? –  cdelacroix Jul 20 '12 at 8:25
    
How do I connect as root? I tried ssh root@192.168.0.3 -p 4212 and I even tried with the usernames of other accounts that are set up in the iMac and it always times out. If I use another port, instead of 4212 it complains "Connection refused", so something should be working, because it appears to answer to the right port. However I still can't connect –  Ralphtor Jul 20 '12 at 12:05
    
The server might not be able to spawn a shell? You can try ssh -vvv root@192.168.0.3 -p 4212 to see (really) verbose output from the client side, or even on the server side put ssh in debug mode to see what is happening (with sshd -d -p 4212). –  cdelacroix Jul 20 '12 at 13:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.