至于如何设置AWS有很多教程,可自行寻找。本文主要介绍如何通过VNC Viewer连解AWS的图形界面。
##创建一个AWS的登陆密码
sudo useradd -m awsgui
sudo passwd awsgui
sudo usermod -aG admin awsgui
sudo vim /etc/ssh/sshd_config # edit line "PasswordAuthentication" to yes
sudo /etc/init.d/ssh restart
##安装Ubuntu的GUI和VNC Viewer
sudo apt-get update
sudo apt-get install ubuntu-desktop
sudo apt-get install vnc4server
su - awsgui
vncserver
vncserver -kill :1
vim /home/awsgui/.vnc/xstartup
打开配置文件后,把第二行和第三行的注释取消,上面写了"Uncomment the following two lines for normal desktop."
在第三行中加入sh,即第三行变为
exec sh /etc/X11/xinit/xinitrc.
保存后启动VNC
vncserver
在本地计算机下载VNCViewer
参考地址:
https://stackoverflow.com/questions/25657596/how-to-set-up-gui-on-amazon-ec2-ubuntu-server