java 调用linux scp命令免密方法
Connection connection = new Connection(ip);
connection.connect();
boolean isauthenticate = connection.authenticateWithPassword("root","123456");
if(isauthenticate==false)throw new Exception("authcation fail");
SCPClient client = new SCPClient(connection);
client.put(dumpPath, toPath);
下载:https://download.csdn.net/download/zhang008_mei/12703853
使用该工具包即可方便操作linux指令,工具包见博客资源下载。