Commit f927b10e authored by Robert Ricci's avatar Robert Ricci

Added message to tell people what to do in case their ssh identity/authorized_keys

aren't set up correctly, and a few misc. cleanups.
parent 772851b7
......@@ -3,26 +3,22 @@
# Location of ssh program
$ssh = "/usr/local/bin/ssh";
# Location of ssh-add program
$add = "/usr/local/bin/ssh-add";
# Remote host to connect to
$host = "plastic.cs.utah.edu";
$host = "paper.cs.utah.edu";
# Make sure they're running ssh-agent
if (!$ENV{SSH_AGENT_PID}) {
print "You should be running ssh-agent - To start it, run:\n";
print "eval `/usr/local/bin/ssh-agent`\n";
print "It would be a good idea to add this to your ~/.login file\n";
}
# String to turn off password authentications
$nopass = "-o 'BatchMode yes'";
# FIXME: Maybe there's a better way to check for this?
if (!`$add -l | grep -v "no identities"`) {
system $add;
}
# Turn off host key checking.... for now.
$nokeycheck = "-o 'StrictHostKeyChecking No'";
# Current working directory:
$cwd = $ENV{PWD};
# Now, do the magic
print "$ssh $host /home/ricci/paperbag dir=$cwd $0 @ARGV";
system "$ssh $host '/home/ricci/paperbag dir=$cwd $0 @ARGV'";
$rv = system "$ssh $host $nopass $nokeycheck dir=$cwd $0 @ARGV";
if ($rv > 256) {
print "SSH failed. You may need to run the following commands:\n";
print "mkdir $ENV{HOME}/.ssh\n";
print "ssh-keygen -P '' -f $ENV{HOME}/.ssh/identity\n";
print "cp $ENV{HOME}/.ssh/identity.pub $ENV{HOME}/.ssh/authorized_keys\n";
}
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