【发布时间】:2016-02-22 15:09:42
【问题描述】:
我有一个用户帐户,但在尝试使用此帐户时,rssh 出现异常。是否有可能使用ChannelExec 以外的其他方式授予目录权限。根据例外情况,我知道这个帐户不能使用ChannelExec 来授予目录或文件的权限。因此,该帐户是否有任何其他方式可以授予文件权限,而无需访问该用户帐户 rssh。请给点意见。
代码:
channelSftp = (ChannelSftp) channel;
ChannelExec channelexe = (ChannelExec) session.openChannel("exec");
channelexe.setCommand("chmod 777 -R " + depDir);
channelexe.connect();
System.out.println("channelexe.getExitStatus:"+channelexe.getExitStatus());
输出:
channelexe.getExitStatus:-1:
This account is restricted by rssh.
Allowed commands: scp sftp
If you believe this is in error, please contact your system administrator.
【问题讨论】:
标签: java file-permissions jsch