Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

vlauciani/guide-to-enable-ssh-on-macosx-recovery-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

License

Guide to enable ssh on macOSX Recovery Mode

Boot in recovery mode

Open Terminal

Go to Utility -> Terminal

Create a writeable ramdisk:

The root account has a random password. And you can’t reset it, since the filesystem is read-only. Use Pubkey authentication!

rdsize=$((16*1024*1024/512)) # 16 megabytes
dev=`hdik -drivekey system-image=yes -nomount "ram://$rdsize"`
echo $?; echo $dev # check for errors!
newfs_hfs $dev
eval `/usr/bin/stat -s /var/root` # store perms for old mountponit
mount -t hfs -o union -o nobrowse $dev /var/root # magic happens here
chown "$st_uid:$st_gid" /var/root
chmod "$st_mode" /var/root

Next, add your key to /var/root/.ssh/authorized_keys.

mkdir /var/root/.ssh
vim /var/root/.ssh/authorized_keys

Generate SSH KEY for the server

ssh-keygen -t rsa

Runs sshd

/usr/sbin/sshd -d -o UsePAM=no -h /var/root/.ssh/id_rsa

Connect from client

ssh root@<ip>

Contribute

Thanks to your contributions!

Here is a list of users who already contributed to this repository:

References

Author

(c) 2021 Valentino Lauciani vlauciani[at]gmail.com

About

Guide to enable ssh on macOSX Recovery Mode

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.