Ssh tunnel (Trent's way): Difference between revisions

From DISI
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:


(1) Open two terminals.  In the first terminal write one of the following lines:
(1) Open two terminals.  In the first terminal write one of the following lines:
  ssh -CL 2222:gimel.ucsf.bkslab.org:22 tbalius@portal.ucsf.bkslab.org -p 22 -i  ~/.ssh/toucsfportal
  ssh -CL 2222:gimel.ucsf.bkslab.org:22 tbalius@portal3.ucsf.bkslab.org -p 22 -i  ~/.ssh/toucsfportal
The above line creates a localhost that points to gimel. It will login to portal.  
The above line creates a localhost that points to gimel. It will login to portal.  


Line 7: Line 7:
If you have multiple keys, use the -i flag to specify the private key location.   
If you have multiple keys, use the -i flag to specify the private key location.   
    
    
  ssh -CL 2222:sgehead.bkslab.org:22 tbalius@portal.ucsf.bkslab.org -p 22 -i  ~/.ssh/toucsfportal
  ssh -CL 2222:sgehead.bkslab.org:22 tbalius@portal3.ucsf.bkslab.org -p 22 -i  ~/.ssh/toucsfportal
The above line, creates a localhost that points to sgehead. It will also connect through portal.   
The above line, creates a localhost that points to sgehead. It will also connect through portal.   
  ssh -CL 2222:gimel.ucsf.bkslab.org:22 tbalius@epsilon.compbio.ucsf.edu -p 22 -i  ~/.ssh/toucsfportal -v
  ssh -CL 2222:gimel.ucsf.bkslab.org:22 tbalius@portal3.ucsf.bkslab.org -p 22 -i  ~/.ssh/toucsfportal -v
This line, will create a localhost that points to gimel and will connect through epsilon (a different name for portal).   
This line, will create a localhost that points to gimel and will connect through epsilon (a different name for portal).   


Line 26: Line 26:


To use proxyfoxy use this
To use proxyfoxy use this
  ssh -D 8081 tbalius@portal.ucsf.bkslab.org -p 22 -i  .ssh/toucsfportal
  ssh -D 8081 tbalius@portal3.ucsf.bkslab.org -p 22 -i  .ssh/toucsfportal

Latest revision as of 18:16, 18 August 2022

(1) Open two terminals. In the first terminal write one of the following lines:

ssh -CL 2222:gimel.ucsf.bkslab.org:22 tbalius@portal3.ucsf.bkslab.org -p 22 -i  ~/.ssh/toucsfportal

The above line creates a localhost that points to gimel. It will login to portal.

This assumes that you have already created the a key pair. See this page How to generate ssh keys securely. The public key has been put onto portal. If you have multiple keys, use the -i flag to specify the private key location.

ssh -CL 2222:sgehead.bkslab.org:22 tbalius@portal3.ucsf.bkslab.org -p 22 -i  ~/.ssh/toucsfportal

The above line, creates a localhost that points to sgehead. It will also connect through portal.

ssh -CL 2222:gimel.ucsf.bkslab.org:22 tbalius@portal3.ucsf.bkslab.org -p 22 -i  ~/.ssh/toucsfportal -v

This line, will create a localhost that points to gimel and will connect through epsilon (a different name for portal).

(2) In the second terminal, you can connect to gimel (or sgehead) with the following.

ssh -p 2222 tbalius@localhost

(3) in the second terminal issue the following command:

scp -P 2222 tbalius@localhost:temp.txt .

this command will copy the file from the remote machine (e.g. sgehead) to the local machine. Or

scp -P 2222 /local/path/file.name tbalius@localhost:/remote/path/

this command will copy the file from the local machine to the the remote machine (e.g. gimel).


To use proxyfoxy use this

ssh -D 8081 tbalius@portal3.ucsf.bkslab.org -p 22 -i  .ssh/toucsfportal