J2TEAM Security: A must-have extension for Chrome users. Install now!

Cách cài remote Desktop cho VPS linux

Tình hình mới vọc cái này xong,viết cái tut cho AE ai chưa cài đặt được thì cài chơi
duyệt web trên vps sướng lắm

Đầu tiên login vào SSH nhé (khuyên dùng Tunnelier nhé)

Bước 1: Cài X Windows System (KDE và GNOME Desktop Environement!)
yum groupinstall "X Window System" "GNOME Desktop Environment"
Đến đoạn nó hỏi Y/n cứ Y rồi ngồi đợi xíu

Chờ xíu nó Complete là được.

Sau khi cài đặt xong GNOME Desktop Environnement,chúng ta chuyển qua KDE chạy lệnh :
yum groupinstall "X Window System" "KDE (K Desktop Environment)"
Đến đoạn nó hỏi Y/n cứ Y rồi ngồi đợi xíu

Bước 2 : Cài đặt VNC Server :
yum install vnc-server
Đợi xíu cài xong nó sẽ báo

Bước 3 : Chỉnh config của VNC Server

Edit file vnc server, chạy lệnh :
vi /etc/sysconfig/vncservers
Nếu ai biết sử dụng Linux rồi thì ko nói , còn ai ko biết thì mở SFTP của tunnelier lên,download file đó về,mở = notepad++ , xong edit : Bỏ 2 dấu # ở 2 câu cuối cùng:
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# 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:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-nohttpd" to prevent web-based VNC clients connecting.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"
Save lại rồi up đè lên file cũ trên server.

Bước 4 : Khởi động VNC Server:
vncserver
Chạy cái này nó sẽ kiu đặt pass khi vào remote desktop.

Lưu ý: linux khi nhập pass nó sẽ ko ra dấu *** như windows mà nó ẩn xuống, nên các bạn cứ nhập xong bấm enter rồi verify lại 1 lần nữa.

Bước 4 : Sửa file xstartup
vi /root/.vnc/xstartup
Bỏ 2 dấu thăngs ở 2 đoạn như code dưới :
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
Còn đây là đoạn code đúng luôn,ai ko biết sửa thì copy cái này vào
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
Bước 5 : Khởi động lại vnc server :
/etc/init.d/vncserver restart
Bước 6 : Khởi động khi bật máy:
chkconfig vncserver on

Bước 7 : Tắt firewall
/etc/init.d/iptables stop
Bước 8 : Tắt firewall khi bật máy
chkconfig iptables off
Xong download file này về chạy theo dạng:
http://www.mediafire.com/?jzw8c51zrp6zj5l
Pass: vanmaihuong-byg
IPserver:1
Demo khi chạy remote desktop linux đây:
http://i942.photobucket.com/albums/ad269/juno_okyo/GhostClub-4rum/vps.png
Leader at J2TEAM. Website: https://j2team.dev/

Đăng nhận xét

Cảm ơn bạn đã đọc bài viết!

- Bạn có gợi ý hoặc bình luận xin chia sẻ bên dưới.

- Hãy viết tiếng Việt có dấu nếu có thể!