23
edits
m |
m |
||
(3 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
Log in with your computer account and at the command line run:<br /> | Log in with your computer account and at the command line run:<br /> | ||
ssh-keygen -t rsa -b 4096 -C " | '''ssh-keygen -t rsa -b 4096 -C "youremail@example.com"''' | ||
This will create the ".ssh" folder, and inside that folder will generate two files, one is the private key "id_rsa", and the other the public key "id_rsa.pub". | This will create the ".ssh" folder, and inside that folder will generate two files, one is the private key "id_rsa", and the other the public key "id_rsa.pub". | ||
Line 13: | Line 13: | ||
'''On the target/server computer:''' | '''On the target/server computer:''' | ||
# Log in with the account that was assigned to you | # Log in with the account that was assigned to you | ||
# On terminal make sure you are at your account home directory: cd ~/ | # On terminal make sure you are at your account home directory: '''cd ~/''' | ||
# If the ".ssh" folder doesn't exist, create one: | # If the ".ssh" folder doesn't exist, create one: '''mkdir .ssh''' | ||
# Set the 700 permissions to .ssh: sudo chmod 700 .ssh | # Set the 700 permissions to .ssh: '''sudo chmod 700 .ssh''' | ||
# Now change directory: cd .ssh | # Now change directory: '''cd .ssh''' | ||
# If the "authorized_keys" file doesn't exist, create one: touch authorized_keys | # If the "authorized_keys" file doesn't exist, create one: '''touch authorized_keys''' | ||
# Set the 644 permissions: sudo chmod 644 authorized_keys | # Set the 644 permissions: '''sudo chmod 644 authorized_keys''' | ||
# And finally, copy and save your public key in this "authorized_keys" file: sudo nano authorized_keys | # And finally, copy and save your public key in this "authorized_keys" file: '''sudo nano authorized_keys''' | ||
'''From your computer:'''<br /> | '''From your computer:'''<br /> | ||
Now, to connect to the server that has your public key, and assuming that the server is using port 22786 for SSH:<br /> | Now, to connect to the server that has your public key, and assuming that the server is using port 22786 for SSH:<br /> | ||
ssh -p 22786 user@host | '''ssh -p 22786 user@host''' | ||
Thanks! | Thanks! |
edits