SSH Login

Here are some basic SSH commands that save me up a lot of time.

SSH login to remote server
ssh -l marcondg ssh -l marcondg
SSH login to remote server with graphics
ssh -X -l marcondg

File Copy

Copying a file from local to host
scp ~/Dropbox/Apps/ scp ~/Dropbox/Apps/
Copying a file from host to local
scp ~/Dropbox/Apps/
Copying an entire folder
scp -r ~/Dropbox/Apps/* scp -r ~/Dropbox/Apps/*
Set up execute and read permissions on all files on all folders recursivelly
chmod -R +xr *

Remote folder Mount

Remote server
mkdir ~/eng/ sshfs ~/eng/
Raspberry Pi
mkdir ~/pi/ sshfs pi@rasp: ~/pi/

SSH login without password

Use this to create your key. Hit ENTER for every prompt.
ssh-keygen -t rsa
Create a .ssh directory on the remote server user home folder
ssh mkdir -p ~/.ssh
Copy your key to the remote server .ssh folder
cat ~/.ssh/ | ssh 'cat >> ~/.ssh/authorized_keys' cat ~/.ssh/ | ssh aadi1@aadi1 'cat >> ~/.ssh/authorized_keys'
Now you can SSH login without typing the password.

TEACH class path

cd /nfs/farm/classes/eecs/spring2017/cs325/handin
Sending terminal commands over SSH withough actual login examples:
ssh pi@rasp '~/mobile/bin/driver' ssh pi@rasp '~/mobile/' ssh pi@rasp '~/mobile/'
Follow this link for the raw script.