User Tools

Site Tools


ssh-remote

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ssh-remote [2007/04/05 16:20] damirssh-remote [2007/08/01 16:00] (current) damir
Line 1: Line 1:
 ====== HowTo connect to servers using SSH ====== ====== HowTo connect to servers using SSH ======
  
-To connect to server, local or remote, you can use the **ssh** client program. When you start a connection to the server using this program, the two machine involved, encrypt all the network traffic generated, so nobody can spy on your connection and see what you are doing. This kind of connection is the only available if you want to use terminal session to connect to our server, no matter if the connection is made locally or from a remote workstation.+To connect to server, local or remote, you can use the **ssh** client program. When you start a connection to the server using this program, the two machine involved, encrypt all the network traffic generated, so nobody can spy on your connection and see what you are doing. __This kind of connection is the only one available if you want to use terminal session to connect to our servers__, no matter if the connection is made locally or from a remote workstation. 
 + 
 + 
 + 
 + 
  
  
Line 11: Line 16:
  
 where <name of the server> can be the letteral name of the server or his IP Address. If this is the first time you try to connect to the server, the system present the remote key and ask you to confirm the connection. Just answer **yes** to the question and the remote system will ask for your username and password.\\ where <name of the server> can be the letteral name of the server or his IP Address. If this is the first time you try to connect to the server, the system present the remote key and ask you to confirm the connection. Just answer **yes** to the question and the remote system will ask for your username and password.\\
-The username parameter is normally inherithed from the login you are using in the local system, so you have to insert only your password to access the remote system. +The username parameter is normally inherited from the login you are using in the local system, so you have to insert only your password to access the remote system.
-<note warning> +
-If you are using the session of another user, to access the remote server, use the **-l <username>** parameter in order to indicate the username you want use on the remote machine. +
-</note>+
 After opening the connection you can work on the server as you where logged on the consolle.\\ After opening the connection you can work on the server as you where logged on the consolle.\\
 +<note> 
 +If you are using the session of another user, to access the remote server, use the **-l <username>** parameter in order to indicate the username you want use on the remote machine.\\ 
 +\\ 
 +Windows users can use [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|putty]], a ssh client with graphical interface, or install [[http://www.cygwin.com/|CygWin]], the Linux-like environment for Windows. 
 +</note> 
 + 
  
 ===== I want graphics ===== ===== I want graphics =====
  
-With the base connection, as the one explained above, you can't access to the graphical interface of the remote system. In order to start programs that have a graphical interface you must use a specific parameter that instruct the system to forward even the graphics connections.+With the base connection, you can't access to the graphical interface of the remote system. In order to start programs that have a graphical interface you must use a specific parameter that instruct the system to forward even the graphics connections.
  
   ssh -l <username> -Y <remote server>   ssh -l <username> -Y <remote server>
Line 27: Line 34:
  
 <note tip> <note tip>
-If you use this trick to see the graphical interface of a machine connected on the other side of the planet, check the bandwidth you can use. X11 connection require a lot of bandwidth.+If you use this trick to see the graphical interface of a machine connected on the other side of the planet, check the bandwidth you can use. connection require a lot of bandwidth.
 </note> </note>
 +
  
 ===== How Access more than one Server ===== ===== How Access more than one Server =====
  
-In a perfect world, Firewalls dosn't exist, but here on earth, Firewalls are absolutely necessary. Firewalls have just one mission: //block everything suspicious or dangerous that is transmitted on the network//. To do this the Firewalls limits the possibilities of connection from remote networks, no matter if the user connecting is good or bad. Of course this means disavantages for the allowed user that can't access directly the servers of the protected network, but must pass from a **gateway**. +In a perfect world, Firewalls doesn't exist, but here on earth, Firewalls are absolutely necessary. Firewalls have just one mission: __//block everything suspicious or dangerous that is transmitted on the network//__. To do this the Firewalls limits the possibilities of connection from remote networks, no matter if the user connecting is good or bad. Of course this means disadvantages for the allowed user that can't access directly the servers of the protected network, but must pass from a **gateway**. 
  
-The simple solution is to connect to the gateway and then, from the gateway, open a ssh connection to the remote server. This can be annoying and difficult if you have to  connect to differents remote server at the same time.\\ +The simple solution is to connect to the gateway and then, from the gateway, open a ssh connection to the remote server. This can be annoying and difficult if you have to  connect to different remote server at the same time.\\ 
-A second option is to connect to the gatewayand at the same time open different **tunnels** that permit to connect to the remote server directly.\\+A second option is to connect to the gateway andat the same timeopen different **tunnels** that permit to connect to the remote server directly.\\
  
-  ssh -l <username> <gateway> -L 2222:<internal linux server>:22+  ssh -l <username> <gateway> -L 2222:<linux server behind firewall>:22
  
-After the correct login in the **gateway**, ssh generate a **tunnel** from the port 2222 of the workstation we are using, to the port 22 of the <internal linux server>. Therefore, we can open another window on the local workstation and from there we can connect to the <internal linux server> directly, pointing the ssh the opened local port:+After the correct login in the **gateway**, ssh generate a **tunnel** from the port 2222 of the workstation we are using, to the port 22 of the <linux server behind firewall>. Therefore, we can open another window on the local workstation and from there we can connect to the <linux server behind firewall> directly, pointing the ssh to the opened local port:
    
   ssh -l <username> 127.0.0.1 -p 2222   ssh -l <username> 127.0.0.1 -p 2222
Line 45: Line 53:
 This solution can be useful for connectin even to remote graphical interfaces, as the Remote Desktop used by Windows XP computers: This solution can be useful for connectin even to remote graphical interfaces, as the Remote Desktop used by Windows XP computers:
  
-  ssh -l <username> <gateway> -L 3390:<internal windows server>:3389+  ssh -l <username> <gateway> -L 3390:<windows server behind firewall>:3389
  
  
 Or to create a **tunnel** inside another **tunnel** Or to create a **tunnel** inside another **tunnel**
  
-  ssh -l <username> <gateway> -L 2222:<internal linux server>:22 +  ssh -l <username> <gateway> -L 2222:<linux server behind firewall>:22 
-  ssh -l <username> 127.0.0.1 -p 2222 -L 3333:<2nd internal linux server>:22+  ssh -l <username> 127.0.0.1 -p 2222 -L 3333:<2nd linux server behind firewall>:22
  
 The two command above must be executed from 2 different terminal windows. The two command above must be executed from 2 different terminal windows.
Line 70: Line 78:
   vncviewer -via username@gateway> <address of remote window server>   vncviewer -via username@gateway> <address of remote window server>
  
-The connections used in the first example are in clear from. This means that all the traffic generated is readable to anyone tha has access to the routers you use to reach the remote server. The second example is more sicure, before establishing the vnc session, the system create a ssh connection and encrypt all the traffic.+The connections used in the first example are in clear from. This means that all the traffic traveling from you laptop and the server is readable to anyone that has access to the routers you use. The second example is more secure, before establishing the vnc session, the system create a ssh connection with the gateway and encrypt all the traffic traveling on the public Internet.
  
 <note> <note>
ssh-remote.1175790001.txt.gz · Last modified: 2007/04/05 16:20 by damir