LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 797|回复: 7

lfs下一直没解决的问题

[复制链接]
发表于 2003-10-11 15:08:50 | 显示全部楼层 |阅读模式
su 成 root 后不能执行X程序,以至于安装时要使用
X的,不得不退出用户,再用root登录。

无论是用xhost和DISPLAY,
还是制定.Xauth..都不行。
提示: sid, su ....
发表于 2003-10-11 15:13:04 | 显示全部楼层
诶?我一直都可以啊?也没设xhost什么的.
发表于 2003-10-11 15:19:25 | 显示全部楼层
好像和Freebsd一样?su的用户不能起X程序
我的解决方法:
1. 启动的时候
startx -listen_tcp
2. 在~/.xinitrc里面加上
xhost localhost
3. 在root用户的~/.bashrc里面加上
export DISPLAY=localhost:0.0(也有可能是1.0什么的,不过0.0一般够了)

再就应该可以了

另外一个变通的方法是用sudo,这个好像不受上面的限制
 楼主| 发表于 2003-10-11 22:42:15 | 显示全部楼层
在我的机器上,有时在用startx时没有问题,而改用kdm后就出问题了。(我的系统基本配置为devfs + bsd style init + xinetd,
不使用xfs,网络为网卡使用dhcpc).
发表于 2003-10-11 23:03:34 | 显示全部楼层
可以这样的。
su -m
 楼主| 发表于 2003-10-11 23:05:17 | 显示全部楼层

提示为:


Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s

估计跟freebsd的情况差不多。
我的配置文件类似于slackware,但不同点在于slackware不使用pam,也不使用xinetd.
发表于 2003-10-11 23:24:41 | 显示全部楼层
Can not execute X program while using "su -m"?
I can .
 楼主| 发表于 2003-10-11 23:25:51 | 显示全部楼层
我有两台机器用lfs,现在这台su下X没问题。但直接在
kconsole下执行xterm出来马上关掉,执行mlterm,
提示Unable to start - open_screen_intern() failed.

另一台机器则是su下X有问题,另外ftp有问题。
ftp登录它时, 当输入用户名, 回车不要求密码, 而是失败,

ftp 192.168.2.180
Connected to 192.168.2.180 (192.168.2.180).
220 work FTP server (GNU inetutils 1.4.2) ready.
Name (192.168.2.180:wang): lfs
530 User lfs access denied.
Login failed.
Remote system type is UNIX.
Using binary mode to transfer files
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表