Access Linux server under Windows via VNC remote, and visualization

Foreword

Recently due to sector needs, the boss want me to get hold of Oracle in the company's Linux server to the database server as a test environment department, after some agonizing after the successful completion of the task. Linux server because the company is no graphical interface, I have little contact with Linux, for more convenient operation, specifically to learn how to access under Linux via VNC in the Windows environment, so that it can operate on the graphical interface.

SecureCRT connection Linux

First, we need to be able to properly connect to the server. Here, I choose to connect to a remote Linux server via SecureCRT (during the mounting operation is very simple, not described in detail herein), after the connection, the terminal may operate similarly Linux directly. After connecting the interface as follows:

WinSCP to upload files

Sometimes we need a Windows remote files on a Linux server, there are many methods. Here, I was through WinSCP, upload files under Windows to Linux servers. WinSCP installation process is very simple operation, the following figure, the left side is a local Windows files, files on the right side is Linux, we simply drag and drop, will complete the implementation file upload function.

(WinSCP download link: https://winscp.net/eng/download.php )

VNC installation

Including VNC VNC Viewer and VNC Server two parts, in order to be able to operate (Linux company is no graphical interface) on the graphical interface, I am here to be achieved through VNC.

1.Windows install VNC Viewer

VNC Viewer is a client application, we mainly use it to establish a connection and remote control, of course, it is also free and open source, and very easy to install.

(VNC Viewer download link: https://www.realvnc.com/en/connect/download/viewer/ )

Install VNC Server on 2.Linux

VNC Server是服务端的应用程序,我们目前需要做的就是使VNC Viewer成功连接上VNC Viewer,这样便可以访问Linux,并实现可视化。

检查Linux是否安装了VNC服务,输入命令:rpm -qa | grep vnc ,如已安装,则会显示已安装的信息。

如果未安装的话,安装VNC Server时,若Linux服务器可正常联网,那么我们可以很方便的通过 yum 命令来安装,在终端输入命令:yum install tigervnc-server ;若无法在Linux下联网,那么我们可以将VNC Server的离线安装包通过上传到服务器,再进行安装。

因为Linux环境无法联网,我的做法是,在自己电脑的CentOS下,通过 yum 命令的 downloadonly 方式,先下载离线安装包,再上传至公司Linux服务器,最后通过 rpm 命令进行安装。

下载离线安装包命令:yum -y install --downloadonly --downloaddir=./temp1 tigervnc-server (./temp1指下载存放路径)

Linux上手动安装命令:rpm -ivh --force --nodeps *.rpm(强制安装当前目录下的所有 .rpm 文件)

安装完成之后,需要开启vncserver服务,输入命令:vncserver ,第一次启动会要求输入密码,按提示操作即可。密码设置后,会产生如下信息:

在此,我们需要记住生成的桌面号(这里生成的桌面号是 :1 ),因为接下来我们通过VNC Viewer访问VNC Server时将会用到。

3.VNC Viewer建立连接

我们需要输入VNC Server和Name,假如Linux服务器的ip地址是10.201.10.10,那么VNC Server输入10.201.10.10:1(1就是上一步骤中分配的桌面号),至于Name,这个就是我们准备给连接起的名字。

建立连接后,可能会遇到如下错误:

这里可能是因为Linux开启了防火墙,会阻止连接过程,解决方法就是我们手动开启相应的端口,以分配的桌面号"1"为例,开启相应端口的命令如下:

[root@localhost ~]# iptables -I INPUT -p tcp --dport 5901 -j ACCEPT 
[root@localhost ~]# iptables -I INPUT -p tcp --dport 5801 -j ACCEPT

解决这个问题后,再次建立连接,可以发现已经能够访问,并能够在图形界面上操作了。

OK,通过以上步骤,我们便可以更方便的在图形界面下操作Linux,比如我们可以通过启动 xhost + ,在图形化界面下完成oracle的安装。

如有错误,欢迎指出!

Guess you like

Origin www.cnblogs.com/wintest/p/11183517.html