/** * Setting this to true trusts hosts whose identity is unknown. * * @param yesOrNo * if true trust the identity of unknown hosts. */ public void setTrust(boolean yesOrNo) { exec.setTrust(yesOrNo); scp.setTrust(yesOrNo); userInfo.setTrust(yesOrNo); }
/** * Copy a file from local computer to a remote computer * * @param vmIpAddress remote computer ip address * @param userName remote user * @param password remote password * @param localFile local file * @param remoteDir remote directory */ public void copyFile(String vmIpAddress, String userName, String password, String localFile, String remoteDir) { Scp scp = new Scp(); scp.setLocalFile(localFile); scp.setTodir(userName + ":" + password + "@" + vmIpAddress + ":" + remoteDir); scp.setProject(PROJECT); scp.setTrust(true); log.info("Copying {} to {} on {}", localFile, remoteDir, vmIpAddress); scp.execute(); }