Skip to content

Instantly share code, notes, and snippets.

@stevenswafford
Created August 26, 2015 00:34
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save stevenswafford/f058e946e29305726310 to your computer and use it in GitHub Desktop.
Save stevenswafford/f058e946e29305726310 to your computer and use it in GitHub Desktop.
SSH Commands
###SSH into a remote machine###
#domain name
ssh user@domain.com
#ip address
ssh user@192.168.1.1
__exit:__ `exit`
###Install###
#update apt-get
sudo apt-get update
#install monodevelop
sudo apt-get install monodevelop
###Copy files###
#copy all of the files in current directory to the /home/ozzy/music directory
rsync -av . ozzy@domain.com:~/music
#delete a file and run rsync again, and it only copies the one mising file
###Generate an SSH keypair for passwordless SSH###
#local computer
cd ~/.ssh
#if the .ssh directory does not exist then create it
ssh-keygen -C "someone@somewhere.com"
#hit enter a few times to generate key
#copy the file contents to the clipboard
cat id_rsa.pub | pbcopy
#log into your machine
ssh someone@somewhere.com
#make the .ssh directory and get in it
mkdir .ssh
cd .ssh
#open authorized_keys in nano and paste the contents in
nano authorized_keys
#paste contents in and save by hitting ctrl+x
#exit and you can now ssh without a password!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment