IT分销/经销sshsftpaix 5.3

AIX 5.3系统的SSH信任关系、SFTP命令报错问题,求解。

问题是这样的。。
在AIX 5.3小型机上新安装了一个SSH,安装成功后,发现执行SFTP命令时,除了root用户的不会报错之外,其他用户都会报这个错。不知道什么原因?

问题一:在执行SFTP命令时报错。

root@:/> sftp [email]fdbsmp@192.168.0.103[/email]
Connecting to 192.168.0.103...
fdbsmp@192.168.0.103's password:
Received message too long 538977059

root@:/> ssh -v
OpenSSH_4.7p1, OpenSSL 0.9.8f 11 Oct 2007


问题二:在配置用户信任关系时报错。

GT3K:<[IBM02:mxjsmp1]:/home/mxjsmp1>ssh-keygen -t dsa
exec(): 0509-036 Cannot load program ssh because of the following errors:
        0509-150   Dependent module /home/mxjsmp1/sms_run/lib/libcrypto.a(libcrypto.so.0.9.8) could not be loaded.
        0509-152   Member libcrypto.so.0.9.8 is not found in archive
参与6

5同行回答

kulalakulala系统运维工程师天津
可以参考下以下:SSH Frequently Asked QuestionsWhen I try to use sftp or scp2, I get a message like this:Received message too long (or "Bad packet length") 1416586337and the connection fails. What's wrong?sftp and scp2 both actually work by running ssh ...显示全部
可以参考下以下:
SSH Frequently Asked Questions
When I try to use sftp or scp2, I get a message like this:

Received message too long (or "Bad packet length") 1416586337

and the connection fails. What's wrong?
sftp and scp2 both actually work by running ssh in a subprocess, to connect to the remote host and run the file-transfer server (usually named sftp-server). For instance, the command sftp server might result in the following command being run (OpenSSH):

ssh server -s -oForwardX11=no -oForwardAgent=no -oProtocol=2 sftp

scp2/sftp and sftp-server use a special file-transfer protocol, which they speak over this SSH session. The protocol is in fact based on the same packet protocol used by SSH.

In order for this to work, the SSH session must be "clean" — that is, it must have on it only information transmitted by the programs at either end. What often happens, though, is that there are statements in either the system or per-user shell startup files on the server (.bashrc, .profile, /etc/csh.cshrc, .login, etc.) which output text messages on login, intended to be read by humans (like fortune, echo "Hi there!", etc.). Such code should only produce output on interactive logins, when there is a tty attached to standard input. If it does not make this test, it will insert these text messages where they don't belong: in this case, polluting the protocol stream between scp2/sftp and sftp-server. The first four bytes of the text gets interpreted as a 32-bit packet length, which will usually be a wildly large number, provoking the error message above. Notice that:

1416586337 decimal = 546F6461 hex = "Toda" ASCII

suggesting a string beginning "Today..." (or maybe "Thank-you" in transliterated Hebrew).

The reason the shell startup files are relevant at all, is that sshd employs the user's shell when starting any programs on the user's behalf (using e.g. /bin/sh -c "command"). This is a Unix tradition, and has advantages:

    The user's usual setup (command aliases, environment variables, umask, etc.) are in effect when remote commands are run.
    The common practice of setting an account's shell to /bin/false to disable it will prevent the owner from running any commands, should authentication still accidentally succeed for some reason.

There has been a lot of argument about whether this is the right behavior, since having sshd instead exec sftp-server directly, without the shell, would avoid this frequent problem. I personally feel that using the shell is the right thing to do: having startup files that emit text messages when there is no user to read them is just a mistake. SSH2 has a Boolean configuration statement AllowCshrcSourcingWithSubsystems, set false by default, which causes sshd2 to pass the -f flag to the shell when running subsystem programs (sftp-server is run as an SSH-2 "subsystem"). With most shells, -f causes the shell to omit the normal startup file processing. This prevents the corruption problem, but introduces other difficulties. With file transfers, the umask setting is important, and people are confused when they find that the umask they set in their ~/.login file works with random remote commands (e.g. ssh server touch foo), but is mysteriously ignored when using scp2/sftp.收起
互联网服务 · 2012-09-10
浏览4509
kulalakulala系统运维工程师天津
第一个问题,是在服务器端,有过多的输出造成的,检查下.profile,是否有echo,cat等命令。显示全部
第一个问题,是在服务器端,有过多的输出造成的,检查下.profile,是否有echo,cat等命令。收起
互联网服务 · 2012-09-10
浏览3897
疯狂石头疯狂石头IT顾问江苏巨鸿
SSH 安装有问题显示全部
SSH 安装有问题收起
IT咨询服务 · 2012-09-10
浏览3765
zhenzongjianzhenzongjian软件开发工程师na
使用root用户做信任关系的吧...显示全部
使用root用户做信任关系的吧...收起
互联网服务 · 2012-09-10
浏览4059
296308389296308389系统管理员epro
大神们都很忙么???连个人影都没有!!!:Q显示全部
大神们都很忙么???连个人影都没有!!!:Q收起
IT分销/经销 · 2012-09-06
浏览3819

提问者

296308389
系统管理员epro

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2012-09-06
  • 关注会员:1 人
  • 问题浏览:16412
  • 最近回答:2012-09-10
  • X社区推广