leichongxiang / sshpt

Automatically exported from code.google.com/p/sshpt
0 stars 0 forks source link

Patch for various fixes and updates #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run old version of sshpt

What is the expected output? What do you see instead?
I expect to find the new features I added, but they are not
there.

What version of the product are you using? On what operating system?

v1.20 on Linux

Please provide any additional information below.

The attached patch includes the following changes:

1. correct misspelled variable name, which led to a bug where quotes
were not doubled when they needed to be.

2. Added ssh config usage (option -F). This allows sshpt to use host
names and ports specified in the ssh configuration file.
   By  default, ~/.ssh/config is used, but another file can be
specified if desired.
   With this change, the names in the hostfile can be ssh config host
names and sshpt will use the HostName and Port from the
   config file if they exist.   Since the real hostname we connect to
could differ from the specified name in the hosts file,
   I had to make a few changes to ensure that the user specified names
would show up in the output.
   I did make sure to maintain the same interfaces so any existing
libraries will continue to work.

3. Added 'use-agent' option (-A) to allow user to specify whether to
use an ssh agent. Without this option, a password based connection
   would try all loaded ssh keys first, wasting time and potentially
losing the connection if the remote host has been configured
   to reject connections after a few failures. This is kind of a
negative option; I added it so I could turn off agent usage by
default, while
   leaving the option to turn it back on if desired.

4. I updated the  handler for the hosts file so one can optionally
specify a username and password, in addition to the host entry. An
entry can now be one of

host
host:username:password
host:username
host::password

Any unspecified value will be pulled from the auth file, which is
still required. That is a minor annoyance when all usernames and
passwords are
specified in the hosts file but I can get around it by specifying a
'fake' auth file.

5. Various small fixes and minor improvements.

Please let me know if you have any questions or comments.

Thanks for writing sshpt; it really fit the bill for what I was doing!

-Gyepi

Original issue reported on code.google.com by gyepi...@gmail.com on 24 Aug 2012 at 1:35

Attachments: