1 查看DISPLAY是否设置:env| grep DISPLAY

如未设置则,export DISPLAY=192.168.0.9:0.0 (斜体字修改为自己的服务器的ip)

2   root用户执行 xhost +

3  切换到oracle用户安装即可

-------------------------------------

https://wiki.archlinux.org/index.php/Running_X_apps_as_root

Running X apps as root

 

By default, and for security reasons, root will be unable to connect to a non-root user's X server. There are multiple ways of allowing root to do so, if it is necessary.

The most secure methods

The most secure methods are simple. They include:

  • kdesu (included with KDE)
$ kdesu name-of-app
  • gksu (included with GNOME)
$ gksu name-of-app
  • bashrun (in community)
$ bashrun --su name-of-app
  • sudo (must be installed and properly configured with visudo)
$ sudo name-of-app
  • sux (wrapper around su which will transfer your X credentials)
$ sux root name-of-app

These are the preferred methods, because they automatically exit when the application exits, negating any security risks quite completely.

Alternate methods

These methods will allow root to connect to a non-root user's X server, but present varying levels of security risks, especially if you run ssh. If you are behind a firewall, you may consider them to be safe enough for your requirements.

  • Temporarily allow root access
  • xhost
$ xhost +

will temporarily allow root, or anyone to connect your X server. Likewise,

$ xhost -

will disallow this function afterward.

Some users also use:

$ xhost + localhost

(Your X server must be configured to listen to TCP connections for xhost + localhost to work).

  • Permanently allow root access
Method 1: Add the line

session optional pam_xauth.so

to /etc/pam.d/su and /etc/pam.d/su-l. Then switch to your root user using 'su' or 'su -'.

Method 2: Globally in /etc/profile

Add the following to /etc/profile

export XAUTHORITY=/home/non-root-usersname/.Xauthority

This will permanently allow root to connect to a non-root user's X server.

Or, merely specify a particular app:

export XAUTHORITY=/home/usersname/.Xauthority kwrite

(to allow root to access kwrite, for instance.)

最新文章

  1. 用grunt进行前端工程化之路
  2. zjuoj 3606 Lazy Salesgirl
  3. EXTJS信息提示框的注意事项
  4. __VA_ARGS__与逗号操作符的巧妙结合
  5. PostgreSQL的 initdb 源代码分析之二十五
  6. java学习之运算符
  7. SQL Server中tempdb的管理
  8. poj 2689 巧妙地运用素数筛选
  9. sqlite 中的分页语句
  10. python程序—利用socket监控端口
  11. Java开发中判断集合类为空的方法-转载
  12. vs链接错误解决方法
  13. CheckForIllegalCrossThreadCalls = false 是干嘛的?
  14. PHP中对象的深拷贝与浅拷贝
  15. Vue混合mixins
  16. PHP下安装memcached
  17. Spring boot 连接Redis实现HMSET操作
  18. FileStorage
  19. IOS-企业开发人员账号&邓白氏码申请记录
  20. 2019.02.12 bzoj3944: Sum(杜教筛)

热门文章

  1. 使用 Git 命令去管理项目的版本控制(二)
  2. 使用Java进行udp-demo编程时碰到的consumer和producter无法连接并报出“java.net.SocketException: Can't assign requested address”问题
  3. 爬虫库之BeautifulSoup学习(二)
  4. int和Integer及拆箱与装箱
  5. 将java项目打包成jar包,之后在制作成可执行的exe文件
  6. c++中stl----map
  7. ThinkPHP3.2.3中,配置文件里配置项的读取
  8. visual editor ve1.5下载
  9. Grid++Report应用(引入项目中)
  10. CodeForces 382C【模拟】