ssh-remote
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ssh-remote [2007/02/13 09:10] – damir | ssh-remote [2007/08/01 18: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. | + | 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. |
- | ==== Connecting to server ==== | + | |
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Connecting to server | ||
All you have to do in order to connect to a local or remote server is to open a terminal window and use the command | All you have to do in order to connect to a local or remote server is to open a terminal window and use the command | ||
- | ssh <name of the server> | + | |
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 | + | The username parameter is normally |
- | < | + | After opening the connection you can work on the server as you where logged on the consolle.\\ |
- | If you are using the session of another | + | < |
+ | If you are using the session of another | ||
+ | \\ | ||
+ | Windows users can use [[http:// | ||
</ | </ | ||
- | After opening the connection you can work on the server as you where logged to the consolle.\\ | + | |
- | == 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 X 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 < | + | |
With the -Y parameter we can start a program on the remote server and his graphical window (if exist) will be displayed on our linux workstation (this works also in windows, if you install CygWin). The program is completely running in the remote server, only the graphical interface is displayed on the local machine. | With the -Y parameter we can start a program on the remote server and his graphical window (if exist) will be displayed on our linux workstation (this works also in windows, if you install CygWin). The program is completely running in the remote server, only the graphical interface is displayed on the local machine. | ||
<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. X connection require a lot of bandwidth. |
</ | </ | ||
- | == How Access more than one Server == | ||
- | In a perfect world, Firewalls dosn't exist, but here on heart, Firewalls are absolutely necessary. Firewalls have just one mission: "block everything suspicious or dangerous that is transmitted on the network" | + | ===== How Access more than one Server ===== |
- | The simple solution | + | In a perfect world, Firewalls doesn' |
- | A second option | + | |
- | ssh -l < | + | 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 gateway | ||
- | After the correct login in the **gateway**, | + | ssh -l < |
+ | |||
+ | After the correct login in the **gateway**, | ||
- | ssh -l < | + | |
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 < | + | ssh -l < |
+ | |||
+ | |||
+ | Or to create a **tunnel** inside another **tunnel** | ||
+ | |||
+ | ssh -l < | ||
+ | ssh -l < | ||
+ | |||
+ | The two command above must be executed from 2 different terminal windows. | ||
+ | |||
+ | |||
+ | ===== HowTo connect to a Graphic Interface ===== | ||
+ | |||
+ | Sometime you have the need to access a server, but this server don't accept terminal connections, | ||
+ | |||
+ | If the version of Windows running on the server is quite old, you can install the program Real VNC (or some other package that derive from this). This program install in the machine and can be used to access the graphical interface of the Operating System, as if in front of the monitor. Remember that the graphical view you have is the same view that has the user that **is** in front of the monitor of the server. | ||
+ | |||
+ | If this server is directly connected to Internet (not real smart thing to do!) you can connect to using the **vncviewer** client program directly: | ||
+ | |||
+ | vncviewer <address of remote window server> | ||
+ | |||
+ | else, if the server is behind a Firewall you can connect to the **gateway** and then use a tunnel for the connection to the server: | ||
+ | |||
+ | vncviewer -via username@gateway> | ||
+ | |||
+ | 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. | ||
+ | |||
+ | < | ||
+ | Sometime can be useful to access the complete graphical interface of Linux from a remote system. In this case we need to launch the **vncserver** process on the linux server that can be used from remote users to access his graphical interface as happens with windows. | ||
+ | </ | ||
+ | |||
+ | A second method to connect to Windows graphical interface is the use of **Remote Desktop** (**rdesktop** for Linux users), both programs use the RDP protocol, developed by MicroSoft. With this client, the users can open a new session on the remote Windows Server and work directly in the graphical interface. The RDP protocol has good performances even on slow connections. To connect to a remote server from a linux workstation open a terminal window and use the command | ||
+ | |||
+ | rdesktop <address of remote server> -u < | ||
+ | |||
+ | If the server is behind a Firewall, you have to open a ssh connection to a **gateway** before you can connect to the server. Use the ssh command to open a tunnel and then the rdesktop command to connect to the remote server passing on the tunnel. | ||
+ | |||
+ | * Open the tunnel to the remote server | ||
+ | |||
+ | | ||
+ | |||
+ | * Open the rdesktop connection to the remote server passing in the tunnel | ||
+ | |||
+ | rdesktop < | ||
+ | |||
+ | |||
+ | ====== ====== | ||
+ | Other useful informations can be found on the manual pages of the commands and on Internet. | ||
ssh-remote.1171354221.txt.gz · Last modified: 2007/02/13 09:10 by damir