[Liunx] VNC(Vnc4Server)方式远程访问Linux主机(适用Debian X版本)

2 篇文章 0 订阅
1 篇文章 0 订阅


Debian X版本配置:

1.查看是否安装VNC

# dpkg -l | grep vnc4server
      #

以上信息显示未安装vnc4server服务。

2.安装vnc服务和桌面服务

# apt-get update

# apt-get install vnc4server

# apt-get install x-window-system-core

# apt-get install gnome-desktop-environment

执行以上命令,没有安装相关程序,则会自动安装,如果安装了一些程序,不会重复安装,会自动跳过。

3.设置 VNC 密码

# vncserver

You will require a password to access your desktops.

Password:

Verify:

Password too long - only the first 8 characters will be used

xauth: creating new authority file /root/.Xauthority

New 'xxx:1 (root)' desktop is xxx:1

Creating default startup script /root/.vnc/xstartup

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/xxx:1.log

这里“Password”是设置vnc的密码,需要输入两边。会在当前用户主目录下 生成 .vnc 目录和配置文件

# vncpasswd

Password:

Verify:

TIPS:如果需要修改vnc密码,则是输入命令:vncpasswd,仍是需要输入两次,设置的密码保存在/root/.vnc/passwd

4.VNC 配置

# cd /root/.vnc/

# ls -l

total 76

-rw-r--r-- 1 root root 1170 Nov 29 20:50 xxx:1.log

-rw-r--r-- 1 root root 5 Nov 29 20:50 xxx:1.pid

-rw------- 1 root root 8 Nov 29 20:51 passwd

-rwxr-xr-x 1 root root 361 Nov 29 20:50 xstartup

TIPS:修改 xstartup 文件 把最后的 x-window-manager & 删掉 加上 gnome-session &

# vim xstartup

#!/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 &

x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

gnome-session &


添加 vncserver 服务

·····························

详细原文地址:http://iblog.daobidao.com/liunx-vnc-vnc4server-remote-access-to-the-linux-host-for-debian-x-version.DaoBiDao



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值