Azure Series Configuration Management Oracle Linux (PART7)

Azure Series Configuration Management Oracle Linux (PART1)

Azure Series Configuration Management Oracle Linux (PART2)

Azure Series Configuration Management Oracle Linux (PART3)

Azure Series Configuration Management Oracle Linux (PART4)

Azure Series Configuration Management Oracle Linux (PART5)

Azure Series Configuration Management Oracle Linux (PART6)

Azure Series Configuration Management Oracle Linux (PART7)

5.2 Changing VNC server configuration

Edit the file / etc / sysconfig / vncservers and modify parameters:

VNCSERVERS =“ 1:toor 2:oracle”

VNCSERVERARGS [1] =“-geometry 1024x768 –depth 24 -nolisten tcp -localhost”

VNCSERVERARGS [2] =“ -geometry 800x600 –depth 16 -nolisten tcp -localhost”

Specific Location:

"-Localhost" option prevents remote VNC client to connect, unless connect through a secure tunnel

"-Depth 16" option to specify the color depth VNC session

Obtaining the new configuration to restart the VNC service:

sudo service vncserver restart
Shutting down VNC server: 1:aroot 2:oracle [ OK ]

Starting VNC server: 1:aroot

New 'fftest5:1 (aroot)' desktop is fftest5:1

Start the application specified in /home/aroot/.vnc/xstartup

Log files are /home/aroot/.vnc/fftest5:1.log

2:oracle

Create a desktop file 'fftest5: 2 (oracle)'

Start the application /home/oracle/.vnc/xstartup

Log Files /home/oracle/.vnc/fftest5:2.log

5.3 Open SSL connections through port forwarding

Local port forwarding syntax used in the examples:

ssh RemoteUsername@RemoteServerHost -L localport:LocalHost:RemotePort

We want to create an encrypted tunnel, and connect to our server via VNC it, but we also make the tunnel is closed vncviewer "Auto Off":

[email protected]–f –L 6901:localhost:5901 -v sleep 10

where:

  • @ toor ** .cloudapp.net   SSH host to connect to

  • -f when executed on a remote computer to sleep, to save the SSH session to the background

  • -L option is enabled local port forwarding

  • 6901 port on the client PC

  • (Remote PC, with the same 127.0.0.1) host server to connect to localhost

  • 5901 port on the remote host (forwarded from a client PC)

  • sleep it remains open for 10 seconds encrypted tunnel. If no application at this time to use it, close it. Conversely, if the application uses it within 10 seconds, the tunnel will remain open until the application is closed. In this way, when closing the vncviewer window, the tunnel will be closed automatically, without any SSH process running on the workstation.

To connect to the VNC server, open a new Xterm session and enter the following command:

vncviewer localhost:6901:1

clip_image001[25]

Figure 17: connect to the VNC server

Open two Xterm session to connect to the VNC server may execute the command all operations:

 

ssh [email protected] –f –L 6901:localhost:5901 sleep 10; vncviewer localhost:6901:1

可以使用远程端口5902打开从本地Linux主机到Oracle Linux IaaS VM 第二条SSH隧道:

[email protected]–f –L 6902:localhost:5902 -v sleep 10

在本地Linux主机到远程VNC服务器上,在新的XTERM会话中运行命令:

vncviewer localhost:6902:2

在VNC身份验证中,指定oracle的用户凭据。

clip_image002[26]

图18:vnc客户端询问Oracle的用户凭证

clip_image004[26]

图19:通过oracle的用户凭证连接到远程Oracle Linux VM

您可以使用唯一命令(在单个Xterm会话中)使用“ oracle”用户证书连接到VNC服务器:

ssh [email protected] –f –L 6902:localhost:5902睡眠10; vncviewer本地主机:6902:2

6 参考

Azure 配置管理系列 Oracle Linux (PART1)

Azure 配置管理系列 Oracle Linux (PART2)

Azure 配置管理系列 Oracle Linux (PART3)

Azure 配置管理系列 Oracle Linux (PART4)

Azure 配置管理系列 Oracle Linux (PART5)

Azure 配置管理系列 Oracle Linux (PART6)

Azure 配置管理系列 Oracle Linux (PART7)

Guess you like

Origin blog.51cto.com/djclouds/2475447