Commit 5ed91b5a authored by Nigel Kukard's avatar Nigel Kukard

Allow ssh agent forwarding

parent f138fbac
......@@ -76,7 +76,7 @@ use User::pwent;
my $NAME = "AWIT-SSH-Client";
our $VERSION = "0.8.8";
our $VERSION = "0.8.9";
print(STDERR "$NAME v$VERSION - Copyright (c) 2016-2017, AllWorldIT\n\n");
......@@ -94,6 +94,10 @@ C<awit-ssh> provides the below commandline options...
Display version information.
=head2 --forward-agent
Forward the ssh-agent socket.
=head2 --knock <HOST:PORT>
Knock on HOST:PORT to gain access.
......@@ -120,6 +124,8 @@ GetOptions(\%optctl,
# TODO: Improve globbing before adding it to displayHelp
"globbing",
"forward-agent",
"knock=s",
"rsync",
......@@ -842,6 +848,7 @@ if (defined($forwardSocket)) {
}
}
# Loop waiting for the socket to be created
my $delay = 30;
while (! -e $libvirtSocket && $delay > 0) {
......@@ -866,6 +873,13 @@ if (defined($forwardSocket)) {
# Normal SSH
} else {
# Check if we're forwarding our agent
if ($optctl{'forward-agent'}) {
# FIXME - check if our keys expire
push(@sshArgs,'-A');
}
system('/usr/bin/ssh',
@sshArgs,
@sshArgsPortForwards,
......@@ -958,6 +972,9 @@ Usage: $0 <options> [USER@]HOST
--help What you're seeing now.
--version Display version.
Agent Fowarding:
--forward-agent Forward SSH agent socket.
Port Knocking:
--knock HOST:PORT Port knock a host to get access.
......
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