If you have no own key in ~/.ssh/ calld id_rsa.pub then create one:
ssh-keygen -t rsa
Copy the public file to the iphone
scp id_rsa.pub root@IPHONIP
Login to iphone
ssh root@IPHONEIP
Copy key to authorized_keys
mkdir .ssh
cat id_rsa.pub >> .ssh/authorized_keys
chmod 644 .ssh/authorized_keys
chmod 700 .ssh
Edit /etc/ssh/sshd_config
nano /etc/ssh/sshd_config
// - uncomment this - //
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
// - to - //
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
Restart sshd
launchctl stop com.openssh.sshd
launchctl start com.openssh.sshd
Everthing in one run
APPLEIP="<IP>"
cat ~/.ssh/id_rsa.pub | ssh root@$APPLEIP '(
cat > /var/root/tmp.pubkey;
mkdir -p /var/mobile/.ssh;
touch /var/mobile/.ssh/authorized_keys;
cat tmp.pubkey >> /var/mobile/.ssh/authorized_key;
chmod 644 /var/mobile/.ssh/authorized_keys;
chmod 700 /var/mobile/.ssh;
mkdir -p /var/root/.ssh;
touch /var/root/.ssh/authorized_keys;
cat tmp.pubkey >> /var/root/.ssh/authorized_keys;
chmod 644 /var/root/.ssh/authorized_keys;
chmod 700 /var/root/.ssh;
rm /var/root/tmp.pubkey;
echo "RSAAuthentication yes" >> /etc/ssh/sshd_config;
echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config;
echo "AuthorizedKeysFile .ssh/authorized_keys" >> /etc/ssh/sshd_config;
launchctl stop com.openssh.sshd;
launchctl start com.openssh.sshd;
)'
dpkg –get-selections> installed-apps.txt
passwd
login mobile
passwd
dpkg --install bigbosshackertools
# Set debs
dpkg –-set-selections< installed-apps.txt
apt-get -u dselect-upgrade
Few adjustments I made that I think are better for iOS 11
Copy key to authorized_keys
Edit /private/etc/ssh/sshd_config
Reasons:
RSAAuthentication
is not in the file by default on Electra jailbreak, it has to be added entirely/.ssh/authorized_keys
otherwise it doesn't know to look in/
(root)