根据文档,在 AWS Transfer SFTP 服务器中为用户创建范围缩小策略时,可以使用策略变量${transfer:HomeFolder}
和${transfer:HomeDirectory}
该策略。但是,我找不到任何关于两者之间区别的描述。有人可以解释或链接到相关文档吗?
我正在尝试使用身份字符串 SFTP 到服务器:SSH-2.0-AWS_SFTP_1.0 使用 sshj 使用以下 Java 代码。
<dependency>
<groupId>com.hierynomus</groupId>
<artifactId>sshj</artifactId>
<version>0.29.0</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
private SSHClient setupSshj(String remoteHost, String username, String password) throws IOException {
SSHClient client = new SSHClient();
client.addHostKeyVerifier(new PromiscuousVerifier());
client.connect(remoteHost);
client.authPassword(username, password);
return client;
}
public void sftpfiles() throws IOException {
if (Boolean.parseBoolean(GetConfigValue("dds", "sendFiles"))) {
SSHClient sshClient = setupSshj(GetConfigValue("dds", "RemoteAddress"), GetConfigValue("dds", "RemoteLogin"), GetConfigValue("dds", "RemotePassword"));
SFTPClient sftpClient = sshClient.newSFTPClient();
sftpClient.put("/home/vm/test.txt", GetConfigValue("dds", "RemoteDirectory"));
sftpClient.close();
sshClients.disconnect();
}
}
Run Code Online (Sandbox Code Playgroud)
并得到错误
错误 SETSTAT 不受支持
我知道 AWS 服务不允许在上传时设置时间戳,但是我不知道需要进行哪些调整才能配置 SFTP 客户端。
问候康泰