java 调用linux scp命令免密方法

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);

使用该工具包即可方便操作linux指令,工具包见博客资源下载。

猜你喜欢

转载自blog.csdn.net/zhang008_mei/article/details/107929367