您的位置:首页 > 运维架构 > Linux

java 使用 ssh 及 scp等 linux 命令、服务,输入密码免打断

2014-08-25 00:00 661 查看
http://www.ganymed.ethz.ch/ssh2/

Connection conn = new Connection(remote);
conn.connect();
boolean isAuthenticated = conn.authenticateWithPassword(user,pw);
if (isAuthenticated == false) throw new IOException("Authentication failed.");
SCPClient client = new SCPClient(conn);
client.put(theFile, remoteDir, "0644");
conn.close();

从 linux 本身来免 密码呢,参考http://blog.csdn.net/wh_19910525/article/details/7433164
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: