Commit 7f5a1be6 authored by Nigel Kukard's avatar Nigel Kukard

Merge branch 'add-debug' into 'master'

Updates

See merge request !49
parents eec01dbe 8557581c
Pipeline #4819 passed with stages
in 2 minutes and 25 seconds
......@@ -77,7 +77,7 @@ use User::pwent;
my $NAME = "AWIT-SSH-Client";
our $VERSION = "0.8.11";
our $VERSION = "0.8.12";
print(STDERR "$NAME v$VERSION - Copyright (c) 2016-2019, AllWorldIT\n\n");
......@@ -99,6 +99,10 @@ C<awit-ssh> provides the below commandline options...
Enable debug output.
=head2 --ipv4
Use IPv4.
=head2 --forward-agent
Forward the ssh-agent socket.
......@@ -125,6 +129,8 @@ GetOptions(\%optctl,
"debug",
"ipv4",
# TODO: Improve globbing before adding it to displayHelp
"globbing",
......@@ -350,13 +356,13 @@ my ($kwalletObject,$kwalletHandle);
# Grab the kwallet service off DBus
my $kwalletService;
eval {
$kwalletService = $dbus->get_service('org.kde.kwalletd');
$kwalletService = $dbus->get_service('org.kde.kwalletd5');
};
if (!defined($kwalletService)) {
logger('WARNING',color('magenta')."Kwallet not found on DBus".color('reset'));
goto KWALLET_END;
}
$kwalletObject = $kwalletService->get_object('/modules/kwalletd','org.kde.KWallet');
$kwalletObject = $kwalletService->get_object('/modules/kwalletd5','org.kde.KWallet');
# Grab a handle to the network wallet
my $networkWalletName = $kwalletObject->networkWallet();
$kwalletHandle = $kwalletObject->open($networkWalletName,0,$NAME);
......@@ -569,11 +575,10 @@ if (defined($kwalletObject) && defined($kwalletHandle)) {
# Check if we need to do port knocking
if (defined($knockHost)) {
if (defined($knockPort)) {
# Make sure we have a port knocking port
if (!defined($knockPort)) {
logger('ERROR',color('bold red')."No port knocking port defined!".color('reset'));
exit 1;
if (!defined($knockHost)) {
$knockHost = $loginHost;
}
logger('NOTICE',"Port knocking '".color('green')."%s".color('reset')."' on port '".color('green')."%s".color('reset')."'...",
......@@ -585,13 +590,6 @@ if (defined($knockHost)) {
Proto => 'tcp',
Timeout => 3
);
# We should get a failure of "Connection refused", if not ERR
if (defined($sock) || $! ne "Connection refused") {
logger('ERROR',color('bold red')."Port knocking failed!".color('reset'));
exit 1;
}
logger('INFO',"Port knocking success!");
print STDERR "\n";
}
......@@ -609,6 +607,11 @@ if (defined($optctl{'debug'})) {
push(@sshArgs,'-v');
}
# Use IPv4
if (defined($optctl{'ipv4'})) {
push(@sshArgs,'-4');
}
# Notify user we'll be forwarding his authentication agent
if (defined($optctl{'forward-agent'})) {
logger('NOTICE',color('red')."Forwarding authentication agent!".color('reset'));
......@@ -631,7 +634,7 @@ if (defined($needDSS)) {
# Try our key only, we should never need to fall back to password
push(@sshArgs,'-o','PreferredAuthentications=publickey');
push(@sshArgs,'-o','StrictHostKeyChecking=ask');
push(@sshArgs,'-o','StrictHostKeyChecking=accept-new');
# Use TCP keepalive
push(@sshArgs,'-o','TCPKeepAlive=yes');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment