SSH key associated with root directory

Not entirely sure what you are asking....

But for Linux ssh files (public rsa, authorized keys, etc) are stored in ~/.ssh

So for root they would be /root/.ssh/

Not sure if this is the same for OSX though.


In OSX, SSH keys are stored in ~/.ssh/id_dsa and ~/.ssh/id_rsa, where ~ is the home folder of the user. Normal users' home folders are generally stored in /Users/, but root's home folder (on OSX; not on Linux) is /var/root. To get to these from your root directory (i.e. /) simply use the cd command as you normally would, although bear in mind that only root is likely to have access to /var/root. Alternatively, you can access hidden folders (those whose names begin with a '.' from the Finder by selecting "Go to Folder..." from the "Go" menu and typing the desired path into the input box that comes up.

Bear in mind that you will need to activate the root user before you can log in using it on the client version of OSX. Be certain you know what you're doing and understand the risks before you enable the root user, especially if you're going to do so on a computer that arbitrary machines will be able to SSH into.