Skip to content

Instantly share code, notes, and snippets.

@vishwasbabu
Last active April 12, 2017 08:19
Show Gist options
  • Save vishwasbabu/f3b89062841016234687 to your computer and use it in GitHub Desktop.
Save vishwasbabu/f3b89062841016234687 to your computer and use it in GitHub Desktop.
Add users to the demo server
Get email Id of the new user : [email protected]
If the user has sent thier public key, skip directly to step 2
1) Generate the new keypair in your mac
=======In you mac=====================
ssh-keygen -t rsa -C "youremailaddress"
You would see the following prompts:
Enter file in which to save the key (/Users/vishwas/.ssh/id_rsa): [Type] yourname
Enter passphrase:[Leave this empty, just hit enter]
You would now see two keys:
yourname [this is the provate key]
yourname.pub [this is the public key]
Now, copy the public key to your clipboard (you can do it on the command line by)
pbcopy < yourname.pub
[You can test it by pasting on sublime text / notepad etc]
2) Append the key in the demo server
login to the demo server:
ssh demo
#Navigate to /.ssh folder
cd ./ssh
# Copy the new key to the end of this file
sudo nano authorized_keys
#preferable add a comment before copying the key, to ease deltion when required
Ex:
#alexmoss
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC02OIj1pBWlX7tynDEXXNMvmj37TfA+SLIhBc+o8SzDdkAmokgH43oQCgTKCY+f2HoVYK59UwwzUzPEo8QdY7ge4jiK/SH7R4PsNGi1LuWTkqiXWboFaUhSsiguKBJgr96PgDR3kZcvP3WxCdAxWGjGZe3Km9sW2zhF4Vw8sQ+hV/JhYjwEIOls7SgFVpgeoXZDCgVz78vrjTmTbJ6yfWN0KqiwUrSbRKLgFQsggWpmdjl5Ca+Y2Z6OGsAS3r2Mcs01jrb1LZPSIqBzJ6JToTyyMvUY2KsupSr0uQxSxkYwBrLmEDgQ6V7hJIY69j5njXrWRBZjaUAg/HsiCiEi5Kj [email protected]
3) Verify you are able to login with the new private key
ssh -i yourname [email protected]
You can then send the private key (christina to the user) .
If the user is using windows etc and needs to convert the same to ppk, instructions can be found at http://support.cdh.ucla.edu/help/132-file-transfer-protocol-ftp/583-converting-your-private-key-
You can also do this conversion on your mac as follows:
puttygen christina -o christina.ppk -O private
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment