Install the SSH public key on the iPhone

Source: Internet
Author: User

1). Generate a key on the Mac Terminal

Ssh-keygen-T rsagenerating public/private RSA key pair. enter file in which to save the key (/home/xxxx /. SSH/id_rsa): Created directory '/home/xxxx /. SSH '. enter passphrase (empty for no passphrase): xxxenter same passphrase again: xxxyour identification has been saved in/home/xxxx /. SSH/id_rsa.your public key has been saved in/home/xxxx /. SSH/id_rsa.pub.the key fingerprint is: e4: E8: B7: 05: 06: B3: F0: FF: AF: 13: FC: 50: 6a: 5b: D1: B5 xxxx@localhost.localdomain
In the process, you will be asked about your pass (passphrase) and enter your frequently used secret.
 
 
 
2). Create the. Ssh directory on the iPhone (the IP address of the iPhone is 10.0.2.2)
SSH root@10.0.2.2 'mkdir-P. Ssh'
If you ask your iPhone root password, enter Alpine.
 
3) copy the public key just generated to the iPhone
Cat ~ /. Ssh/id_rsa.pub | SSH root@10.0.2.2 'cat>. Ssh/authorized_keys'
If you ask your iPhone root password, enter Alpine.
 
4) edit the/etc/ssh/sshd_config file on the iPhone.
# Replace # strictmodes yes # pubkeyauthentication yes # authorizedkeysfile. Ssh/authorized_keys # With strictmodes nopubkeyauthentication yesauthorizedkeysfile. Ssh/authorized_keys
 
5). Restart the iPhone. OK!
 
 
 
 
 
By sschu
 
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.