這是本文件的舊版!
Remote Desktop
CentOS5/RHEL5
使用vnc做為remote desktop連線軟體。更多可參考官網文件。
修改連線解析度
修改/etc/sysconfig/vncserver檔案。以下面範例而言,使用者root可透過5900+1的port連線,其解析度為800×600。
# vim /etc/sysconfig/vncserver VNCSERVERS="1:root" VNCSERVERARGS[1]="-geometry 800x600"如果今天Jeff想用1024×768,可以這樣設定:
# vim /etc/sysconfig/vncserver VNCSERVERS="1:root 2:jeff" VNCSERVERARGS[1]="-geometry 800x600" VNCSERVERARGS[2]="-geometry 1024x768"
為新使用者設定vnc
參考官網文件的2.4. Create xstartup scripts內容。在新增完使用者之後,必須登入那個使用者,並且輸入vncpasswd設定vnc密碼。接著啟動與停止vncserver service以產生config。最後是修改.vnc下的xstartup,如果沒修改連過去會是一個非常醜的連線畫面。這裡可以直接copy現成的xstartup即可。
CentOS6/RHEL6
在CentOS6/RHEL6中必須要安裝tigervnc-server package。使用vncpasswd建立使用者密碼,最後和CentOS5/RHEL5一樣修改/etc/sysconfig/vncserver。
以新增一個user vnc desktop做為範例:
新增使用者
# useradd tonylin # passwd tonylin Changing password for user tonylin. New password: Retype new password: passwd: all authentication tokens updated successfully.
設定VNC
# ssh tonylin@localhost # vncpasswd Password: Verify: # logout # service vncserver stop # vim /etc/sysconfig/vncserver VNCSERVERS="1:root 2:tonylin" VNCSERVERARGS[1]="-geometry 800x600" VNCSERVERARGS[2]="-geometry 1024x768" # service vncserver start
其它
如果在start/stop vncserver service有問題的時候,可以用vncserver -kill指令做處理,砍掉沒正常停止的vncserver process。
# vncserver -list TigerVNC server sessions: X DISPLAY # PROCESS ID :1 1637 # vncserver -kill :1
SuSe
設定VNC
安裝系統時,就可以選擇Enable Remote Administration。如果安裝後要去enable呢? 可以透過ssh連進去執行yast2,沒ssh就…
如下圖選擇Network Services > Remote Administration,
然後打勾Allow Remote Administration,最後請確認有在Firewall中打開VNC使用port(請勿學我去關閉firewall):
也可以透過GUI使用yast去設定,選單路徑與透過ssh執行yast2大同小異。
Ubuntu
使用RXDP套件,讓我可以透過Windows遠端桌面連線,擁有比較好的解析度。
遇到的問題
按鍵D跳桌面
參考此篇文章,執行gconf-enditor並依照apps : metacity : global_keybindings路徑找尋show_desktop的關鍵字,對它點右鍵執行Unset Key並重開機即可。
只能登入一次
參考此篇文章,將/etc/pam.d/common-auth中的auth optional pam_smbpass.so migrate注解,並複製到/etc/pam.d/samba的@include common-auth下方,最後重新開機即可。照文章敘述看起來是由於samba授權認証導致了xrdp的crash。