Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
allworldit
awit-ssh-client
Commits
7f5a1be6
Commit
7f5a1be6
authored
Aug 24, 2019
by
Nigel Kukard
Browse files
Merge branch 'add-debug' into 'master'
Updates See merge request
!49
parents
eec01dbe
8557581c
Changes
1
Hide whitespace changes
Inline
Side-by-side
awit-ssh
View file @
7f5a1be6
...
...
@@ -77,7 +77,7 @@ use User::pwent;
my
$NAME
=
"
AWIT-SSH-Client
";
our
$VERSION
=
"
0.8.1
1
";
our
$VERSION
=
"
0.8.1
2
";
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.kwalletd
5
');
};
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/kwalletd
5
','
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
(
$knock
Hos
t
))
{
if
(
defined
(
$knock
Por
t
))
{
# 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=a
sk
');
push
(
@sshArgs
,'
-o
','
StrictHostKeyChecking=a
ccept-new
');
# Use TCP keepalive
push
(
@sshArgs
,'
-o
','
TCPKeepAlive=yes
');
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment