• 5
name Punditsdkoslkdosdkoskdo

How to enable SSH on a Mac in single user mode?

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/ failed: -10

What should I do?

Looks like you need to load some more plists:

launchctl load /System/Library/LaunchDaemons/
launchctl load /System/Library/LaunchDaemons/
launchctl load /System/Library/LaunchDaemons/
launchctl load /System/Library/LaunchDaemon/

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. :)

  • 4
Reply Report

Three solutions you could consider. First, try target disk mode. If single user mode works, then target disk mode should work as well.

Once it is started in target disk mode, plug it into the other system you have (using firewire), and tell the second system to boot externally (hold down option on boot). Once the OS in the damaged system boots using the local systems hardware, open System Preferences and click on “Sharing” Select the checkbox next to “Remote Login” to enable it.

Shut down and restart, and you should have SSH up and running.

A second option is to remove the hard drive from the damaged system and boot from it externally (in an external enclosure) or place it inside your functional system and boot from there.

If neither of those work, but you are running single user, consider

cd /Library/Preferences
echo -n enabled >

This will turn on screen sharing, use that to access System Preferences on the remote machine, make the changes (turn on SSH) and you are functional.

  • 1
Reply Report