mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-06-05 20:27:29 +00:00
24 lines
516 B
Perl
24 lines
516 B
Perl
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
use Term::ReadLine;
|
|
use PVE::AccessControl;
|
|
|
|
my $username = shift;
|
|
die "Username missing" if !$username;
|
|
sub read_password {
|
|
|
|
my $term = new Term::ReadLine ('pveum');
|
|
my $attribs = $term->Attribs;
|
|
$attribs->{redisplay_function} = $attribs->{shadow_redisplay};
|
|
my $input = $term->readline('password: ');
|
|
return $input;
|
|
}
|
|
|
|
my $password = read_password();
|
|
PVE::AccessControl::authenticate_user($username,$password);
|
|
|
|
print "Authentication Successful!!\n";
|
|
|
|
exit (0);
|