您好,登錄后才能下訂單哦!
一、安裝所需要的軟件
yum install -y xrdp
yum install -y vnc*
chkconfig xrdp on
chkconfig vncserver on
二、修改配置
a添加用戶:useradd herry
b.設置vnc驗證密碼:su - herry
: vncpasswd
c.修改配置:
1.[root@cloud ~]# vim /etc/sysconfig/vncservers
# 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 this URL:
# https://access.redhat.com/knowledge/solutions/7027
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# 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="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
VNCSERVERS="2:herry"
VNCSERVERARGS[1]="-geometry 1280x720 -nolisten tcp -localhost"
2.在防火墻中加入:
vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3389 -j ACCEPT
重啟防火墻:service iptabels restart
三、一般服務器是沒有桌面環境的,需要安裝中文界面
yum groupinstall "Desktop"
yum groupinstall "X Window System"
yum groupinstall "Chinese Support"
重啟
四、使用windows連接linux遠程桌面
a.windows上敲mstsc
b.輸入liunx服務器Ip地址,和驗證用戶名和密碼(herry l426844@)
五 報錯處理:出現xrdp_mm_process_login_response: login failed
問題原因:遠程桌面沒有正確關閉,雖然在windows 系統關閉遠程桌面連接,但是在里linux上的進程還在運行,導致連接數量達到上限,出現問題。
[root@cloud ~]# vim /etc/xrdp/sesman.ini
[Globals]
ListenAddress=127.0.0.1
ListenPort=3350
EnableUserWindowManager=1
UserWindowManager=startwm.sh
DefaultWindowManager=startwm.sh
[Security]
AllowRootLogin=1
MaxLoginRetry=4
TerminalServerUsers=tsusers
TerminalServerAdmins=tsadmins
[Sessions]
X11DisplayOffset=10
MaxSessions=100
KillDisconnected=1
IdleTimeLimit=0
DisconnectedTimeLimit=0
[Logging]
LogFile=/var/log/xrdp-sesman.log
LogLevel=DEBUG
EnableSyslog=0
SyslogLevel=DEBUG
[X11rdp]
param1=-bs
param2=-nolisten
param3=tcp
[Xvnc]
param1=-bs
param2=-nolisten
param3=tcp
param4=-localhost
可以修改會話設置 :將最大會話限制該大 MaxSessions=50
將KillDisconnected=1;則每次斷開連接時,linux都會關閉會話進程。
然后重啟/etc/init.d/xrdp restart 就可解決問題
六.如果打開后,出現只有背景的情況
下面我們需要修改vnc啟動文件,使用命令:
vi ~/.vnc/xstartup
打開后如下圖所示
我們需要把上圖中 “x-window-manager &” 這一行注釋掉,然后在下面加入一行 “gnome-session &” ,或者是 “startkde &” ,分別表示要啟用 GNOME 桌面或 KDE 桌面。以 GNOME 桌面為例,修改后如下圖所示:
具體修改步驟:打開文件后,點擊 insert 按鈕,這時就可以輸入了,在 “x-window-manager &” 前加 “#”,然后回車輸入 “gnome-session &”,然后點擊 “Esc ” 退出編輯模式,輸入 “:wq!”保存修改即可)
我的機器:
[root@cloud ~]# vi ~/.vnc/xstartup
#!/bin/sh
[ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
export LANG
export SYSFONT
vncconfig -iconic &
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`
if [ $OS = 'Linux' ]; then
case "$WINDOWMANAGER" in
*gnome*)
if [ -e /etc/SuSE-release ]; then
PATH=$PATH:/opt/gnome/bin
export PATH
fi
;;
esac
fi
if [ -x /etc/X11/xinit/xinitrc ]; then
exec /etc/X11/xinit/xinitrc
fi
if [ -f /etc/X11/xinit/xinitrc ]; then
exec sh /etc/X11/xinit/xinitrc
fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
七。登陸成功
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。