Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.