AndyJarrett

Another setting up a Server guide- Git

This is a second part of multiple posts all about setting your (Ubuntu) server (like the web needs one). I'm slowly moving over to Docker but recently I dumped my scripts in to github. These are my own guides to setting up a site which I have been updating over time.

Fork me on Github from the ubuntu/ folder

See the other post here

This is a short one covering getting Git installed and copying over and protecting your Private Key.

Installing Git

sudo apt-get update && sudo apt-get install git  

Adding your private key

If you are connecting to Git repo's then you'll need a private key on your server.

cat ~/.ssh/id_rsa | ssh andyjarrett@example.com -p303030 'cat >> .ssh/id_rsa'  

YOU SHOULD GUARD THIS KEY with your life, so make sure you change the permission to 600 so other users on the system won't have access to it. N.B. the following command is not run with sudo as this is your file.

chmod 600 id_rsa