Java mtime.sec 不存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22226440/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
mtime.sec is not present
提问by user2190101
I am facing a tricky situation here. I have a java based application that tries to scp remote machines to copy certain files. While performing those tasks , I am finding the below error message from the application side.
我在这里面临一个棘手的情况。我有一个基于 java 的应用程序,它尝试 scp 远程机器来复制某些文件。在执行这些任务时,我从应用程序端发现以下错误消息。
scp protocol error mtime.sec not present
But when I manually try to scp from the server to endpoint machine, I am able to do it without issues.
但是当我手动尝试从服务器到端点机器的 scp 时,我能够毫无问题地做到这一点。
The command I am using for manual testing is scp localfile user@hostname:/tmp/
我用于手动测试的命令是 scp localfile user@hostname:/tmp/
I am not sure of the error message mtime.sec is not present
. Does anyone can throw some lights here. I couldn't find useful info from web, Any experts thoughts would help a lot.
我不确定错误信息mtime.sec is not present
。有没有人可以在这里扔一些灯。我无法从网上找到有用的信息,任何专家的想法都会有很大帮助。
As SCP is working normally using manual process, I am not sure there is something wrong with SCP.
由于 SCP 使用手动流程正常工作,我不确定 SCP 是否有问题。
采纳答案by Bao Ho
I've got the same issue. It worked for me if I scp to ubuntu 12.04. When I did that to ubuntu 14.04, it failed with same message.
我有同样的问题。如果我 scp 到 ubuntu 12.04,它对我有用。当我对 ubuntu 14.04 执行此操作时,它失败并显示相同的消息。
I wrote the scp code based on this example http://www.jcraft.com/jsch/examples/ScpTo.java.html. I guess you too.
我根据这个例子编写了 scp 代码http://www.jcraft.com/jsch/examples/ScpTo.java.html。我猜你也是。
If I remove the whitespace after the "T" in the following line, it'll work. Change:
如果我删除下一行中“T”后面的空格,它将起作用。改变:
command="T "+(_lfile...
to
到
command="T"+(_lfile...
Either do that or set ptimestamp = false
要么这样做,要么设置 ptimestamp = false
回答by zzapper
protocol error: mtime.sec not delimited
I Googled this and learnt that this is a convoluted error message. We recently disabled our root login by making it 'nologin'. I forgot to update my scp script which was still trying to login as root. When I updated it use the new login all was fine. (sorry nothing to do with Java)
我用谷歌搜索了一下,发现这是一个复杂的错误信息。我们最近通过将其设置为“nologin”来禁用我们的 root 登录。我忘了更新我的 scp 脚本,它仍然试图以 root 身份登录。当我更新它时,使用新的登录名一切都很好。(抱歉与Java无关)
回答by Riccardo
Like ZZapper above writes.
就像上面的 ZZapper 所写。
I ran into the same issue as above, trying to use scp to connect to a remote site and it also told me "protocol error: mtime.sec not delimited "
我遇到了与上面相同的问题,尝试使用 scp 连接到远程站点,它还告诉我“协议错误:mtime.sec 未分隔”
Running scp with -vvvv
it turned out on the 'server side' they disallowed me to use scp and told me to use sftp instead.
scp with -vvvv
结果是在“服务器端”运行它,他们不允许我使用 scp 并告诉我改用 sftp。
回答by T. Matre
I learned my issue derived from the fact that our stftp server solely allows sftp connections. scp is not allowed.
我了解到我的问题源于我们的 stftp 服务器只允许 sftp 连接这一事实。scp 是不允许的。
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
Sink: This service allows sftp connections only.
protocol error: mtime.sec not present