redhad5 配置多用户同时登陆vnc各自界面

简介:

1.系统是Redhat5,它是系统安装是默认安装vnc的。Redhat6以上的可能需要自己安装vnc。

2.新建用户

        [root@localhost~]# useradd tang

        [root@localhost~]# useradd example

        [root@localhost~]# useradd jake

        [root@localhost~]# ls /home/

        example  jake tang

        [root@localhost~]#

3.在个宿主目录新建 .vnc文件并设置vnc密码(必须先改权限,再设置密码)

        [root@localhost~]# su - tang

        [tang@localhost~]$ chmod 777 -R .vnc/

        [tang@localhost~]$ cd .vnc

        [tang@localhost.vnc]$ ll -a

总计 12

        drwxrwxrwx2 tang tang 4096 07-05 06:17 .

        drwx------5 tang tang 4096 07-05 06:18 ..

        -rwxrwxrwx1 tang tang    8 07-05 06:17 tang

        [tang@localhost.vnc]$ vncpasswd

        Password:

        Verify:

        [tang@localhost.vnc]$ ll -a

总计 16

        drwxrwxrwx2 tang tang 4096 07-05 06:36 .

        drwx------5 tang tang 4096 07-05 06:18 ..

        -rw-------1 tang tang    8 07-05 06:36 passwd

        -rwxrwxrwx1 tang tang    8 07-05 06:17 tang





        [example@localhost~]$ mkdir .vnc

        [example@localhost~]$ ll -a

总计 40

        drwx------5 example example 4096 07-05 06:18 .

        drwxr-xr-x5 root    root    4096 07-05 06:14 ..

        -rw-r--r--1 example example   33 07-05 06:14.bash_logout

        -rw-r--r--1 example example  176 07-05 06:14.bash_profile

        -rw-r--r--1 example example  124 07-05 06:14.bashrc

        -rw-r--r--1 example example  515 07-05 06:14 .emacs

        drwxr-xr-x3 example example 4096 07-05 06:14 .kde

        drwxr-xr-x4 example example 4096 07-05 06:14 .mozilla

        drwxrwxr-x2 example example 4096 07-05 06:18 .vnc

        [example@localhost~]$ chmod 777 -R .vnc/

        [example@localhost~]$ vncpasswd

        Password:

        Verify:

        [example@localhost~]$ ll -a .vnc/

总计 16

        drwxrwxrwx2 example example 4096 07-05 06:34 .

        drwx------5 example example 4096 07-05 06:20 ..

        -rwxrwxrwx1 example example    8 07-05 06:19example

        -rw-------1 example example    8 07-05 06:34 passwd






        [jake@localhost~]$ mkdir .vnc

        [jake@localhost~]$ cd .vnc/

        [jake@localhost~]$ chmod 777 -R .vnc/

        [jake@localhost~]$ cd .vnc/

        [jake@localhost.vnc]$ vncpasswd

        Password:

        Verify:

        [jake@localhost.vnc]$

        [jake@localhost.vnc]$ ll -a

总计 12

        drwxrwxr-x2 jake jake 4096 07-05 06:20 .

        drwx------5 jake jake 4096 07-05 06:20 ..

        -rw-------1 jake jake    8 07-05 06:20 jake

        [jake@localhost.vnc]$



        [root@localhost~]# mkdir .vnc

        [root@localhost~]# cd .vnc/

        [root@localhost.vnc]# vncpasswd root

        Password:

        Verify:

        [root@localhost.vnc]# ll -a

总计 16

        drwxr-xr-x  2 root root 4096 07-05 06:21 .

        drwxr-x---17 root root 4096 07-05 06:21 ..

        -rw-------  1 root root   8 07-05 06:21 root

        [root@localhost.vnc]#

4.编辑vnc配置文件:

        vim/etc/sysconfig/vncservers

        #VNCSERVERS="2:myusername"

        VNCSERVERS="1:root2:jake 3:example 4:tang"

        VNCSERVERARGS[1]="-geometry800x600 -depth 24"

        VNCSERVERARGS[2]="-geometry800x600 -depth 24"

        VNCSERVERARGS[3]="-geometry800x600 -depth 24"

        VNCSERVERARGS[4]="-geometry800x600 -depth 24"

5.启动vnc

        [root@localhost.vnc]# /sbin/service vncserver restart

关闭 VNC 服务器:1:root2:jake 3:example 4:tang            [确定]

启动 VNC 服务器:1:root

        New'localhost.localdomain:1 (root)' desktop is localhost.localdomain:

        Startingapplications specified in /root/.vnc/xstartup

        Logfile is /root/.vnc/localhost.localdomain:1.log

        2:jake

        New'localhost.localdomain:2 (jake)' desktop is localhost.localdomain:2

        Startingapplications specified in /home/jake/.vnc/xstartup

        Logfile is /home/jake/.vnc/localhost.localdomain:2.log

        3:example

        New'localhost.localdomain:3 (example)' desktop is localhost.localdomain:3

        Startingapplications specified in /home/example/.vnc/xstartup

        Logfile is /home/example/.vnc/localhost.localdomain:3.log

        4:tang

        New'localhost.localdomain:4 (tang)' desktop is localhost.localdomain:4

        Startingapplications specified in /home/tang/.vnc/xstartup

        Logfile is /home/tang/.vnc/localhost.localdomain:4.log

                                                         [确定]

        [root@localhost.vnc]#

6.测试:

测试出现下面界面已经成功:

210704628.png

210706668.png

210708605.png

210710518.png

7.解决灰色背景:

vnc配置文件的

#twm &改为

startkde &

如下:

[jake@localhost ~]$ cd .vnc/

[jake@localhost .vnc]$ vim xstartup

#!/bin/sh


# Uncomment the following two lines fornormal 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 &

startkde &

重启vnc即可:

210910607.png

210912848.png

210914268.png

210917385.png




本文转自 zhuxtqw 51CTO博客,原文链接:http://blog.51cto.com/1054054/1260850,如需转载请自行联系原作者

相关文章
|
5月前
|
Linux 数据安全/隐私保护
centos8 免登陆 免密码 多用户命令行 启动 ,以及 界面免密
centos8 免登陆 免密码 多用户命令行 启动 ,以及 界面免密
120 0
|
7月前
|
存储 数据安全/隐私保护 Windows
Win11 系统登录用户时无法登录
Win11系统,在未绑定和注册微软账号的情况下,使用邮箱注册绑定了微软账号,在win+L锁定屏幕后出现无法登录账号的情况,登录按钮只现实两个字,密码输入框不显示,点击登录后无反应或者加载几圈后回到登录原始页面。
116 0
|
9月前
|
C++ Windows
Windows用户如何将cpolar内网穿透配置成后台服务,并开机自启动?
本文介绍,如何将cpolar配置成后台服务,并且开机自动启动。
|
网络安全 数据安全/隐私保护 Android开发
想知道Android手机怎么远程登录到系统后台吗?看这里
想知道Android手机怎么远程登录到系统后台吗?看这里
想知道Android手机怎么远程登录到系统后台吗?看这里
|
Linux
Linux安装Gnome桌面并自定义登录界面
Linux安装Gnome桌面并自定义登录界面
453 0
|
网络安全 数据安全/隐私保护
Mac iterm2快捷登录\免密登录服务器
Mac iterm2快捷登录\免密登录服务器
Mac iterm2快捷登录\免密登录服务器
|
Linux 网络安全 数据安全/隐私保护
SSH登录树莓派、远程桌面登录树莓派以及VNC方式登录树莓派
SSH登录树莓派、远程桌面登录树莓派以及VNC方式登录树莓派
294 0
SSH登录树莓派、远程桌面登录树莓派以及VNC方式登录树莓派
|
Ubuntu Java Linux
本机Linux子系统Ubuntu免密登陆远程服务器同时实现多用户免密登陆服务器
本机Linux子系统Ubuntu免密登陆远程服务器同时实现多用户免密登陆服务器
452 0
本机Linux子系统Ubuntu免密登陆远程服务器同时实现多用户免密登陆服务器
|
数据安全/隐私保护 API 移动开发
登陆功能的实现
我不喜欢废话,上代码 /// /// 运行程序返回进程pid /// /// /// static public int RunProgram(string qqPath) ...
902 0
|
测试技术 数据安全/隐私保护