And query the password on demand.
+ my $password = $param->{password};
+ if (!defined($password)) {
+ $password = PVE::PTY::read_password("Remote password: ");
+ }
+
my $setup = {
username => $param->{username},
my $setup = {
username => $param->{username},
- password => $param->{password},
host => $param->{host},
port => $param->{port} // 8006,
};
host => $param->{host},
port => $param->{port} // 8006,
};
host => { optional => 0 },
comment => { optional => 1 },
username => { optional => 0 },
host => { optional => 0 },
comment => { optional => 1 },
username => { optional => 0 },
- password => { optional => 0 },
+ password => { optional => 1 },
port => { optional => 1 },
fingerprint => { optional => 1 },
};
port => { optional => 1 },
fingerprint => { optional => 1 },
};
my ($class, $cfg, $remote) = @_;
my $section = $class->lookup_remote($cfg, $remote);
my ($class, $cfg, $remote) = @_;
my $section = $class->lookup_remote($cfg, $remote);
+
+ my $password = $section->{password};
+ if (!defined($password)) {
+ $password = PVE::PTY::read_password("Remote password: ")
+ }
+
my $conn = PVE::APIClient::LWP->new(
username => $section->{username},
my $conn = PVE::APIClient::LWP->new(
username => $section->{username},
- password => $section->{password},
host => $section->{host},
host => $section->{host},
- port => $section->{port},
+ port => $section->{port} // 8006,
cached_fingerprints => {
$section->{fingerprint} => 1,
}
cached_fingerprints => {
$section->{fingerprint} => 1,
}