报错原因是ssh错误地使用了库文件/opt/csw/lib/libcrypto.so.0.9.7所致。
root用户执行ssh时报错:
root@mlctest01:~ #> ssh
ld.so.1: ssh: fatal: relocation error: file /usr/bin/ssh: symbol SUNWcry_installed: referenced symbol not found
Killed
检查ssh使用的库
root@mlctest01:~ #> ldd `which ssh`
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libz.so.1 => /opt/csw/lib/libz.so.1
libz.so.1 (SUNW_1.1) => (version not found)
libcrypto.so.0.9.7 => /opt/csw/lib/libcrypto.so.0.9.7
libgss.so.1 => /usr/lib/libgss.so.1
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
libmd.so.1 => /usr/lib/libmd.so.1
libscf.so.1 => /usr/lib/libscf.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libcmd.so.1 => /usr/lib/libcmd.so.1
libdoor.so.1 => /usr/lib/libdoor.so.1
libuutil.so.1 => /usr/lib/libuutil.so.1
libgen.so.1 => /usr/lib/libgen.so.1
libm.so.2 => /usr/lib/libm.so.2
/platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1
查看LD_LIBRARY_PATH环境变量设置
root@mlctest01:~ #> echo $LD_LIBRARY_PATH
.:/afc/lib:/opt/csw/lib:/opt/csw/ssl/lib:/usr/local/lib:/usr/local/ssl/lib:/app/oracle/product/client/10.2.0.1/lib32:/usr/lib
把/usr/sfw/lib路径加入到LD_LIBRARY_PATH环境变量的最前面
root@mlctest01:~ #> export LD_LIBRARY_PATH=/usr/sfw/lib:$LD_LIBRARY_PATH
再次执行ssh成功
root@mlctest01:~ #> ssh
Usage: ssh [options] host [command]
Options:
-l user Log in using this user name.
-n Redirect input from /dev/null.
-F config Config file (default: ~/.ssh/config).
-A Enable authentication agent forwarding.
-a Disable authentication agent forwarding (default).
-X Enable X11 connection forwarding.
-x Disable X11 connection forwarding (default).
-i file Identity for public key authentication (default: ~/.ssh/identity)
-t Tty; allocate a tty even if command is given.
-T Do not allocate a tty.
-v Verbose; display verbose debugging messages.
Multiple -v increases verbosity.
-V Display version number only.
-q Quiet; don't display any warning messages.
-f Fork into background after authentication.
-e char Set escape character; ``none'' = disable (default: ~).
-c cipher Select encryption algorithm
-m macs Specify MAC algorithms for protocol version 2.
-p port Connect to this port. Server must be on the same port.
-L listen-port:host:port Forward local port to remote address
-R listen-port:host:port Forward remote port to local address
These cause ssh to listen for connections on a port, and
forward them to the other side by connecting to host:port.
-D port Enable dynamic application-level port forwarding.
-C Enable compression.
-N Do not execute a shell or command.
-g Allow remote hosts to connect to forwarded ports.
-1 Force protocol version 1.
-2 Force protocol version 2.
-4 Use IPv4 only.
-6 Use IPv6 only.
-o 'option' Process the option as if it was read from a configuration file.
-s Invoke command (mandatory) as SSH2 subsystem.
-b addr Local IP address.
检查ssh版本
root@mlctest01:~ #> ssh -V
Sun_SSH_1.1.2, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
root用户执行ssh时报错:
root@mlctest01:~ #> ssh
ld.so.1: ssh: fatal: relocation error: file /usr/bin/ssh: symbol SUNWcry_installed: referenced symbol not found
Killed
检查ssh使用的库
root@mlctest01:~ #> ldd `which ssh`
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libz.so.1 => /opt/csw/lib/libz.so.1
libz.so.1 (SUNW_1.1) => (version not found)
libcrypto.so.0.9.7 => /opt/csw/lib/libcrypto.so.0.9.7
libgss.so.1 => /usr/lib/libgss.so.1
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
libmd.so.1 => /usr/lib/libmd.so.1
libscf.so.1 => /usr/lib/libscf.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libcmd.so.1 => /usr/lib/libcmd.so.1
libdoor.so.1 => /usr/lib/libdoor.so.1
libuutil.so.1 => /usr/lib/libuutil.so.1
libgen.so.1 => /usr/lib/libgen.so.1
libm.so.2 => /usr/lib/libm.so.2
/platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1
查看LD_LIBRARY_PATH环境变量设置
root@mlctest01:~ #> echo $LD_LIBRARY_PATH
.:/afc/lib:/opt/csw/lib:/opt/csw/ssl/lib:/usr/local/lib:/usr/local/ssl/lib:/app/oracle/product/client/10.2.0.1/lib32:/usr/lib
把/usr/sfw/lib路径加入到LD_LIBRARY_PATH环境变量的最前面
root@mlctest01:~ #> export LD_LIBRARY_PATH=/usr/sfw/lib:$LD_LIBRARY_PATH
再次执行ssh成功
root@mlctest01:~ #> ssh
Usage: ssh [options] host [command]
Options:
-l user Log in using this user name.
-n Redirect input from /dev/null.
-F config Config file (default: ~/.ssh/config).
-A Enable authentication agent forwarding.
-a Disable authentication agent forwarding (default).
-X Enable X11 connection forwarding.
-x Disable X11 connection forwarding (default).
-i file Identity for public key authentication (default: ~/.ssh/identity)
-t Tty; allocate a tty even if command is given.
-T Do not allocate a tty.
-v Verbose; display verbose debugging messages.
Multiple -v increases verbosity.
-V Display version number only.
-q Quiet; don't display any warning messages.
-f Fork into background after authentication.
-e char Set escape character; ``none'' = disable (default: ~).
-c cipher Select encryption algorithm
-m macs Specify MAC algorithms for protocol version 2.
-p port Connect to this port. Server must be on the same port.
-L listen-port:host:port Forward local port to remote address
-R listen-port:host:port Forward remote port to local address
These cause ssh to listen for connections on a port, and
forward them to the other side by connecting to host:port.
-D port Enable dynamic application-level port forwarding.
-C Enable compression.
-N Do not execute a shell or command.
-g Allow remote hosts to connect to forwarded ports.
-1 Force protocol version 1.
-2 Force protocol version 2.
-4 Use IPv4 only.
-6 Use IPv6 only.
-o 'option' Process the option as if it was read from a configuration file.
-s Invoke command (mandatory) as SSH2 subsystem.
-b addr Local IP address.
检查ssh版本
root@mlctest01:~ #> ssh -V
Sun_SSH_1.1.2, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/228190/viewspace-672930/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/228190/viewspace-672930/