Remote connection in Linux SSH and VNC graphics mode

  
1. Start/stop/restart of VNC #service vncserver start/stop/restart Close the specific vncserver command: vncserver -kill :1 vncserver -kill :22, set password #vncpasswd3, Client login in the vnc client input: server IP: 1 or server IP: 24, set to log in to the KDE desktop a. [root@centos ~] # vi /etc/sysconfig/vncservers ## Uncomment the line below to Start a VNC server on display :1# as my 'myusername' (adjust this to your own). You will also# need to set a VNC password; run 'man vncpasswd' to see how# to do that.## DO NOT RUN THIS SERVICE if your local area network is# untrusted! For a secure way of using VNC, see# <URL:>.[url]http://www.uk.research.att.com/vnc/sshvnc. Html[/url]# VNCSERVERS="1:myusername"VNCSERVERS="1:root"# VNCSERVERARGS[1]="-geometry 800x600"VNCSERVERARGS[1]="-geometry 800*600 -alwaysshared -depth 24"-alwaysshared means that multiple users can be logged in at the same time -depth is colored , Parameters 8,16,24,32. Note: The red part is the part that was modified or added b.[root@centos .vnc]$ vi /root/.vnc/xstartup #!/bin/sh# Uncomment the following two lines for normal desktop:unset SESSION_MANAGERexec /etc/X11/xinit/xinitrc[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresourcesxsetroot -solid greyvncconfig -iconic &xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &#gnome-session & #set starting GNOME desktopstartkde & #kde desktop#twm & #Text interfaceNote: The red part is The modified or added part c. Restart VNC. Reference: We know that under Windows, we can use Remote Desktop Connection to control other computer
, but how to connect in Linux environment? But before we say how to connect, we must first clear a concept, why My title does not use the remote desktop connection in Linux, this is because the desktop under Linux, which is what we call X Window, is just an application under Linux, so the remote connection in Linux is divided into shell and X. There are two types of desktop connections. Let's talk about connecting to the shell under linux via SSH (Secure Shell). If the operating platform is windows, you can download the SSH client tool to connect to linux. For example, the most commonly used PuTTY, you can download it here: [url] Http://www.chiark.greenend.org.uk/~sgtatham/putty/[/url] After running, enter the IP of your Linux host as shown, the default port is 22, then click Open, the login will appear. Interface, enter the username and password:: The login process is complete. If your client also uses linux, it is more convenient, directly enter: ssh -l username [address of the remote host] connection, the first connection will let you confirm, enter yes, and then enter the password on the line . In fact, through the ssh connection, we can completely manage the host remotely, but sometimes we need to do something under the X Window, the next step is to talk about how to remotely connect to the Linux desktop. Usually we use XDM (X Display Manager) and VNC to connect remotely. Here I want to use vnc to implement remote connection. It is certainly not unfamiliar to mention VNC. It is a remote control software for the platform. With the server side installed on Linux, we can connect through the client. Installation is not much to say, after the completion of the prompt at the prompt: vncserver Even if it is started, pay attention to the number behind 1, after the connection to use this vnc server will start, if you run vncserver for the first time, will You are asked to enter an access code. If you are connecting to Linux under the windows platform, then directly install the vnc client, that is, install vncviewer, start after the installation is complete: Enter the IP plus identification number, if the previous vnc service is 1, then fill in here 1, and so on. Click OK: Enter the access password and press Enter: The connection is successful. If your operating platform is linux, then at the prompt, type: vncviewer IP : x (x is the identifier), you can connect. There is also a case, if the Linux host is connected to Windows, in addition to using vnc, there is a toolkit similar to the remote desktop in Windows in Linux, that is Rdesktop, enter: rdesktop ip at the prompt. In addition, you also start in the gnome tool menu: Enter IP, username and password, if there is no domain, leave it blank, then connect, just like XP desktop, it is very convenient, by the way, if you want to connect to linux The host is located in the LAN. Don't forget to do the port mapping. If you use SSH to map 22 to the host, if you are using VNC, you should use your ID. For example, in Figure 1, port 5901 is mapped. analogy.
Copyright © Windows knowledge All Rights Reserved