com.jcraft.jsch.JSchException: java.io.IOException: 管道关闭
com.jcraft.jsch.JSchException: java.io.IOException: Pipe closed
我正在尝试使用 Jcraft JSch (http://www.jcraft.com/jsch/) 通过 SFTP 将文件复制到另一个主机。我遇到以下错误:
Connecting via SSH to somehost:22
com.jcraft.jsch.JSchException: java.io.IOException: Pipe closed
at com.jcraft.jsch.ChannelSftp.start(ChannelSftp.java:315)
at com.jcraft.jsch.Channel.connect(Channel.java:152)
at com.jcraft.jsch.Channel.connect(Channel.java:145)
相关代码如下:
Channel channel = null;
ChannelSftp channelSftp = null;
Exception cause = null;
try {
connect();
channel = session.openChannel( "sftp" );
channelSftp = (ChannelSftp)channel;
channelSftp.connect();
assert channelSftp != null;
try {
channelSftp.ls( destDir );
} catch( SftpException sftpEx ) {
// Create destination folder, if it does not exist
execCommand( "some command" + destDir );
}
自上周以来一切正常,升级到最新的 jcraft 版本不起作用。我参考了 this and this(参考页面上的最后评论),但无法找到根本原因。有帮助吗?
SSH 工作正常。问题出在 SSH 配置中的 SFTP 模块路径。 link 以下无法访问。
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
我正在尝试使用 Jcraft JSch (http://www.jcraft.com/jsch/) 通过 SFTP 将文件复制到另一个主机。我遇到以下错误:
Connecting via SSH to somehost:22
com.jcraft.jsch.JSchException: java.io.IOException: Pipe closed
at com.jcraft.jsch.ChannelSftp.start(ChannelSftp.java:315)
at com.jcraft.jsch.Channel.connect(Channel.java:152)
at com.jcraft.jsch.Channel.connect(Channel.java:145)
相关代码如下:
Channel channel = null;
ChannelSftp channelSftp = null;
Exception cause = null;
try {
connect();
channel = session.openChannel( "sftp" );
channelSftp = (ChannelSftp)channel;
channelSftp.connect();
assert channelSftp != null;
try {
channelSftp.ls( destDir );
} catch( SftpException sftpEx ) {
// Create destination folder, if it does not exist
execCommand( "some command" + destDir );
}
自上周以来一切正常,升级到最新的 jcraft 版本不起作用。我参考了 this and this(参考页面上的最后评论),但无法找到根本原因。有帮助吗?
SSH 工作正常。问题出在 SSH 配置中的 SFTP 模块路径。 link 以下无法访问。
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server