com.rationaleemotions.pojo.PasswordlessEnabledUser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simple-ssh Show documentation
Show all versions of simple-ssh Show documentation
A simple way of interacting with a remote host for executing commands, scp (upload and download)
package com.rationaleemotions.pojo;
import com.jcraft.jsch.UserInfo;
/**
* Represents a user for whom it's assumed that passwordless setup has already been completed.
* Passwordless setup refers to the process wherein a user is allowed login to a remote host via ssh
* without being prompted for their password.
* The setup is fairly simple. Please refer here for more details
* on how to setup passwordless access
* to a remote host.
*/
public class PasswordlessEnabledUser implements UserInfo {
private String passphrase;
public PasswordlessEnabledUser(String passphrase) {
this.passphrase = passphrase;
}
@Override
public String getPassphrase() {
return passphrase;
}
@Override
public String getPassword() {
return null;
}
@Override
public boolean promptPassword(String message) {
return false;
}
@Override
public boolean promptPassphrase(String message) {
return passphrase != null;
}
@Override
public boolean promptYesNo(String message) {
return false;
}
@Override
public void showMessage(String message) {
//No Op implementation
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy