xterm 不再以 root 用户身份在 RHEL6 上启动

xterm 不再以 root 用户身份在 RHEL6 上启动

即使读完这两本我也完全陷入困境(如果还不是很明显的话,我对 Linux 没有太多经验。)

我正在尝试安装WebSphere 8.5RHEL6.安装管理器 GUI 一切顺利,但在 、 和 之后IBMHTTPServerWeb Server PluginWebSphere Customization Toolbox无法启动安装管理器。

搜索互联网让我相信测试是否xterm有效将是一个好主意,但不幸的是事实并非如此。

# whoami
root
# xterm
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

我使用连接到 Linux 机器mobaXterm,并且 xterm 命令通过相同的连接在克隆的虚拟机上运行良好。

# echo $DISPLAY
localhost:10.0
# xauth list
ap01/unix:10  MIT-MAGIC-COOKIE-1  7f20dc9e52baff302a442c46bbd4869b

再说一遍,我对此很陌生,因此可能不了解相关内容,如果我可以发布更多信息,请告诉我。

IBMIM 错误(由于字符限制已删除):

./IBMIM
(IBMIM:22290): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(IBMIM:22290): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

...

(IBMIM:22289): Pango-CRITICAL **: pango_layout_get_line_count: assertion `layout != NULL' failed Floating point exception (core dumped)~

添加xlockxmag、 和ssh -v输出:

ssh -v root@<ip_address>
OpenSSH_6.2p2, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to <ip_address> [<ip_address>] port 22.
debug1: Connection established.
debug1: identity file /home/mobaxterm/.ssh/id_rsa type -1
debug1: identity file /home/mobaxterm/.ssh/id_rsa-cert type -1
debug1: identity file /home/mobaxterm/.ssh/id_dsa type -1
debug1: identity file /home/mobaxterm/.ssh/id_dsa-cert type -1
debug1: identity file /home/mobaxterm/.ssh/id_ecdsa type -1
debug1: identity file /home/mobaxterm/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 [email protected]
debug1: kex: client->server aes128-ctr hmac-md5 [email protected]
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA f6:69:0b:e8:73:a6:8e:5a:e5:de:95:96:cb:61:2e:4a
debug1: Host '<ip_address>' is known and matches the RSA host key.
debug1: Found key in /home/mobaxterm/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/mobaxterm/.ssh/id_rsa
debug1: Trying private key: /home/mobaxterm/.ssh/id_dsa
debug1: Trying private key: /home/mobaxterm/.ssh/id_ecdsa
debug1: Next authentication method: password
root@<ip_address>'s password:
debug1: Enabling compression at level 6.
debug1: Authentication succeeded (password).
Authenticated to <ip_address> ([<ip_address>]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: No xauth program.
debug1: Requesting X11 forwarding with authentication spoofing.
Last login: Thu Mar 27 15:43:13 2014 from <build_machine_ip_address>
# xlock
-bash: xlock: command not found
# xmag
Error: Can't open display: localhost:12.0

验证xauth安装和PATH(老实说,我不是100%认为下面的内容足够了,xauth和之间有什么区别xorg-x11-xauth?,只需要父目录包含在PATH?等中):

[root@vm-ap01 apps]# yum whatprovides xauth
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
1:xorg-x11-xauth-1.0.2-7.1.el6.x86_64 : X.Org X11 X authority utilities
Repo        : myrepo
Matched from:
Other       : xauth



1:xorg-x11-xauth-1.0.2-7.1.el6.x86_64 : X.Org X11 X authority utilities
Repo        : installed
Matched from:
Other       : Provides-match: xauth



[root@vm-ap01 apps]# rpm -ql xauth
package xauth is not installed
[root@vm-ap01 apps]# rpm -ql xorg-x11-xauth
/usr/bin/mkxauth
/usr/bin/xauth
/usr/share/doc/xorg-x11-xauth-1.0.2
/usr/share/doc/xorg-x11-xauth-1.0.2/AUTHORS
/usr/share/doc/xorg-x11-xauth-1.0.2/COPYING
/usr/share/doc/xorg-x11-xauth-1.0.2/ChangeLog
/usr/share/doc/xorg-x11-xauth-1.0.2/NEWS
/usr/share/doc/xorg-x11-xauth-1.0.2/README
/usr/share/man/man1/mkxauth.1x.gz
/usr/share/man/man1/xauth.1.gz
[root@vm-ap01 apps]# echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

我不太确定“从远程端”,但下面是通过mobaxterm我的工作站连接到 RHEL 盒子时的输出:

[root@vm-ap01 apps]# echo $DISPLAY
localhost:13.0
[root@vm-ap01 apps]# xauth list | awk '{print $1, $2}'
vm-ap01/unix:10 MIT-MAGIC-COOKIE-1
vm-ap01/unix:11 MIT-MAGIC-COOKIE-1
vm-ap01/unix:12 MIT-MAGIC-COOKIE-1
vm-ap01/unix:13 MIT-MAGIC-COOKIE-1
vm-ap01/unix:14 MIT-MAGIC-COOKIE-1

[root@vm-ap01 apps]# strace xclock
execve("/usr/bin/xclock", ["xclock"], [/* 34 vars */]) = 0
brk(0)                                  = 0xc2b000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611d5000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=99025, ...}) = 0
mmap(NULL, 99025, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f08611bc000
close(3)                                = 0
open("/usr/lib64/libXaw.so.7", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@|!\3601\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=412648, ...}) = 0
mmap(0x31f0200000, 2506392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x31f0200000
mprotect(0x31f025a000, 2093056, PROT_NONE) = 0
mmap(0x31f0459000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x59000) = 0x31f0459000
close(3)                                = 0
open("/usr/lib64/libXmu.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0pf`/:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=107600, ...}) = 0
mmap(0x3a2f600000, 2201280, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a2f600000
mprotect(0x3a2f618000, 2097152, PROT_NONE) = 0
mmap(0x3a2f818000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x3a2f818000
close(3)                                = 0
open("/usr/lib64/libXt.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p1\2418:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=412832, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611bb000
mmap(0x3a38a00000, 2508640, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a38a00000
mprotect(0x3a38a5f000, 2093056, PROT_NONE) = 0
mmap(0x3a38c5e000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5e000) = 0x3a38c5e000
mmap(0x3a38c64000, 1888, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3a38c64000
close(3)                                = 0
open("/usr/lib64/libX11.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\334\3412:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1300376, ...}) = 0
mmap(0x3a32e00000, 3394936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a32e00000
mprotect(0x3a32f37000, 2097152, PROT_NONE) = 0
mmap(0x3a33137000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x137000) = 0x3a33137000
close(3)                                = 0
open("/usr/lib64/libXrender.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\30\3404:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=42472, ...}) = 0
mmap(0x3a34e00000, 2135176, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a34e00000
mprotect(0x3a34e09000, 2097152, PROT_NONE) = 0
mmap(0x3a35009000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x3a35009000
close(3)                                = 0
open("/usr/lib64/libXft.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320? ::\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=88632, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611ba000
mmap(0x3a3a200000, 2181216, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a3a200000
mprotect(0x3a3a214000, 2097152, PROT_NONE) = 0
mmap(0x3a3a414000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x3a3a414000
close(3)                                = 0
open("/usr/lib64/libxkbfile.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320J`\3601\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=151792, ...}) = 0
mmap(0x31f0600000, 2245768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x31f0600000
mprotect(0x31f0623000, 2097152, PROT_NONE) = 0
mmap(0x31f0823000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x23000) = 0x31f0823000
mmap(0x31f0824000, 1160, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x31f0824000
close(3)                                = 0
open("/lib64/libm.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p> 0:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=599384, ...}) = 0
mmap(0x3a30200000, 2633912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a30200000
mprotect(0x3a30283000, 2093056, PROT_NONE) = 0
mmap(0x3a30482000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x82000) = 0x3a30482000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\356!/:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1926800, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611b9000
mmap(0x3a2f200000, 3750152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a2f200000
mprotect(0x3a2f38b000, 2093056, PROT_NONE) = 0
mmap(0x3a2f58a000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18a000) = 0x3a2f58a000
mmap(0x3a2f58f000, 18696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3a2f58f000
close(3)                                = 0
open("/usr/lib64/libXext.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3006 3:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=80944, ...}) = 0
mmap(0x3a33200000, 2174216, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a33200000
mprotect(0x3a33212000, 2097152, PROT_NONE) = 0
mmap(0x3a33412000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12000) = 0x3a33412000
close(3)                                = 0
open("/usr/lib64/libXpm.so.4", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`/\340\3571\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=72832, ...}) = 0
mmap(0x31efe00000, 2165496, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x31efe00000
mprotect(0x31efe11000, 2093056, PROT_NONE) = 0
mmap(0x31f0010000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x31f0010000
close(3)                                = 0
open("/usr/lib64/libSM.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\32`?:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=34024, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611b8000
mmap(0x3a3f600000, 2126776, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a3f600000
mprotect(0x3a3f607000, 2097152, PROT_NONE) = 0
mmap(0x3a3f807000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x3a3f807000
close(3)                                = 0
open("/usr/lib64/libICE.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0pM`>:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=101608, ...}) = 0
mmap(0x3a3e600000, 2208960, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a3e600000
mprotect(0x3a3e617000, 2097152, PROT_NONE) = 0
mmap(0x3a3e817000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x3a3e817000
mmap(0x3a3e818000, 13504, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3a3e818000
close(3)                                = 0
open("/usr/lib64/libxcb.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\230`2:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=124728, ...}) = 0
mmap(0x3a32600000, 2217576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a32600000
mprotect(0x3a3261d000, 2097152, PROT_NONE) = 0
mmap(0x3a3281d000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d000) = 0x3a3281d000
close(3)                                = 0
open("/lib64/libdl.so.2", O_RDONLY)     = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\r\340.:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=22536, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611b7000
mmap(0x3a2ee00000, 2109696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a2ee00000
mprotect(0x3a2ee02000, 2097152, PROT_NONE) = 0
mmap(0x3a2f002000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x3a2f002000
close(3)                                = 0
open("/usr/lib64/libfontconfig.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\\`4:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=223040, ...}) = 0
mmap(0x3a34600000, 2316776, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a34600000
mprotect(0x3a34634000, 2097152, PROT_NONE) = 0
mmap(0x3a34834000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x34000) = 0x3a34834000
close(3)                                = 0
open("/usr/lib64/libfreetype.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\310\2404:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=644912, ...}) = 0
mmap(0x3a34a00000, 2737840, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a34a00000
mprotect(0x3a34a98000, 2093056, PROT_NONE) = 0
mmap(0x3a34c97000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x97000) = 0x3a34c97000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611b6000
open("/lib64/libuuid.so.1", O_RDONLY)   = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\25 ;:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=18936, ...}) = 0
mmap(0x3a3b200000, 2111272, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a3b200000
mprotect(0x3a3b204000, 2093056, PROT_NONE) = 0
mmap(0x3a3b403000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x3a3b403000
close(3)                                = 0
open("/usr/lib64/libXau.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\r\2402:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=13168, ...}) = 0
mmap(0x3a32a00000, 2106112, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a32a00000
mprotect(0x3a32a02000, 2097152, PROT_NONE) = 0
mmap(0x3a32c02000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x3a32c02000
close(3)                                = 0
open("/lib64/libexpat.so.1", O_RDONLY)  = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320<`3:\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=167648, ...}) = 0
mmap(0x3a33600000, 2260432, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3a33600000
mprotect(0x3a33626000, 2093056, PROT_NONE) = 0
mmap(0x3a33825000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x3a33825000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611b5000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611b4000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611b2000
arch_prctl(ARCH_SET_FS, 0x7f08611b2740) = 0
mprotect(0x3a30482000, 4096, PROT_READ) = 0
mprotect(0x3a2f58a000, 16384, PROT_READ) = 0
mprotect(0x3a2f002000, 4096, PROT_READ) = 0
mprotect(0x3a2ec1f000, 4096, PROT_READ) = 0
munmap(0x7f08611bc000, 99025)           = 0
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=99158576, ...}) = 0
mmap(NULL, 99158576, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f085b321000
close(3)                                = 0
brk(0)                                  = 0xc2b000
brk(0xc4c000)                           = 0xc4c000
open("/proc/meminfo", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611d4000
read(3, "MemTotal:        1923456 kB\nMemF"..., 1024) = 1024
close(3)                                = 0
munmap(0x7f08611d4000, 4096)            = 0
socket(PF_NETLINK, SOCK_RAW, 0)         = 3
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(3, {sa_family=AF_NETLINK, pid=30849, groups=00000000}, [12]) = 0
sendto(3, "\24\0\0\0\26\0\1\3\320\3545S\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"0\0\0\0\24\0\2\0\320\3545S\201x\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 108
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"@\0\0\0\24\0\2\0\320\3545S\201x\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 128
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\320\3545S\201x\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/etc/nsswitch.conf", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1688, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611d4000
read(3, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1688
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f08611d4000, 4096)            = 0
open("/etc/host.conf", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=9, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611d4000
read(3, "multi on\n", 4096)             = 9
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f08611d4000, 4096)            = 0
getpid()                                = 30849
open("/etc/resolv.conf", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=355, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f08611d4000
read(3, "# Generated by NetworkManager\n\n\n"..., 4096) = 355
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f08611d4000, 4096)            = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=99025, ...}) = 0
mmap(NULL, 99025, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f08611bc000
close(3)                                = 0
open("/lib64/tls/x86_64/libnss_files,dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/tls/x86_64", 0x7fff58448b00) = -1 ENOENT (No such file or directory)
open("/lib64/tls/libnss_files,dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/tls", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
open("/lib64/x86_64/libnss_files,dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/x86_64", 0x7fff58448b00)   = -1 ENOENT (No such file or directory)
open("/lib64/libnss_files,dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64", {st_mode=S_IFDIR|0555, st_size=12288, ...}) = 0
open("/usr/lib64/tls/x86_64/libnss_files,dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/tls/x86_64", 0x7fff58448b00) = -1 ENOENT (No such file or directory)
open("/usr/lib64/tls/libnss_files,dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/tls", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
open("/usr/lib64/x86_64/libnss_files,dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/x86_64", 0x7fff58448b00) = -1 ENOENT (No such file or directory)
open("/usr/lib64/libnss_files,dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64", {st_mode=S_IFDIR|0555, st_size=69632, ...}) = 0
munmap(0x7f08611bc000, 99025)           = 0
open("/usr/lib64/X11/XtErrorDB", O_RDONLY) = -1 ENOENT (No such file or directory)
getuid()                                = 0
geteuid()                               = 0
getuid()                                = 0
write(2, "Error: ", 7Error: )                  = 7
write(2, "Can't open display: localhost:13"..., 34Can't open display: localhost:13.0) = 34
write(2, "\n", 1
)                       = 1
exit_group(1)                           = ?
[root@vm-ap01 apps]#

看起来 SE Linux 也已启用:

[root@vm-ap01 apps]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

答案1

debug1: No xauth program.

这看起来是个问题。确保您xauth在服务器和客户端上都安装了该程序。您以 root 身份登录,因此请确保它xauth也在 root 的 PATH 中。我不完全确定这就是问题所在,因为在我的测试中,-v如果 X11 转发由于缺乏 xauth 而无法工作,我发现其他错误消息(“X11 转发请求在通道 0 上失败”,即使没有 也会出现),但这可能是由于版本或配置差异造成的。


strace xclock输出中,您确定了工作机器和非工作机器之间不匹配的行。在非工作机器上:

open("/lib64/tls/x86_64/libnss_files,dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)

该文件名是错误的:libnss_files,dns.so.2不应该存在,存在的是libnss_files.so.2libnss_dns.so.2。这些文件被使用国家安全局,标准 C 库的组件,用于管理主机、用户等名称的源。典型的源包括files( /etc/hosts, /etc/passwd, ...),dns,ldap等等。您有一个名为 的源,files,dns而不是一个名为 的源files和一个名为 的源dns。编辑文件/etc/nsswitch.conf并将行更改SOMETHING: files,dnsSOMETHING: files dns,即单词必须以空格分隔,而不是逗号分隔。

我不完全理解跟踪,但这绝对是错误的,可能会导致您的问题。特别是,我认为错误的hosts: …/etc/nsswitch.conf可能会导致您的系统找不到localhost.

相关内容