I am trying to connect to do ssh to target host through a proxy and
issue some commands and get back some results .
Has anyone seen below problem . I am using plink 0.60
I dont understand where is this ↕ charecter getting added from
****************************************
Opening direct-tcpip channel to calih1↕:22 in place of session
Server refused to open a direct-tcpip channel
FATAL ERROR: Server refused to open a direct-tcpip channel
******************************************
C:>plink.exe -v -pw <PASSWORD> root@calis1 -nc calih1:22 "ls -l"
Looking up host "calis1"
Connecting to 130.200.29.237 port 22
Server version: SSH-2.0-Sun_SSH_1.1
We claim version: SSH-2.0-PuTTY_Release_0.60
Using SSH protocol version 2
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-1
Host key fingerprint is:
ssh-rsa 1024 c2:36:91:c9:d6:ad:2f:0c:75:33:f5:59:a8:91:da:af
Initialised AES-128 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-128 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Using username "root".
Access granted
Opening direct-tcpip channel to calih1↕:22 in place of session
Server refused to open a direct-tcpip channel
FATAL ERROR: Server refused to open a direct-tcpip channel
This is a known bug with "-nc" in 0.60. It's fixed in the development
snapshots, but there's not yet a release containing the fix.
<http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/cmdline-nc-garbage.html>
I now took the Development Snapshot of entire source and built . and
then ran the same command .
Now the command-line keeps on hanging after the last line .
I was expecting the command to return with output of command run .
*****************************************************
C:\Ashish\Secure Library\putty-src\WINDOWS\MSVC\PLINK\Debug>plink.exe -
v -pw <password> root@calis1 -nc calih1:22 "ls -l"
Looking up host "calis1"
Connecting to 130.200.29.237 port 22
Server version: SSH-2.0-Sun_SSH_1.1
Using SSH protocol version 2
We claim version: SSH-2.0-PuTTY_Local:_Feb_16_2010_16:19:39
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-1
Host key fingerprint is:
ssh-rsa 1024 c2:36:91:c9:d6:ad:2f:0c:75:33:f5:59:a8:91:da:af
Initialised AES-128 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-128 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Using username "root".
GSSAPI authentication initialisation failed
The target was not recognized.
Access granted
Opening direct-tcpip channel to calih1:22 in place of session
Opened direct-tcpip channel
SSH-2.0-OpenSSH_4.2p1-hpn
******************************************
Thnaks
Ashish
On Feb 16, 2:56 pm, Jacob Nevins <jac...@chiark.greenend.org.uk>
wrote:
> <http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/cmdline-nc...>
I tried this one which also kept on hanging .
***************************************************************************
plink.exe -v -pw <password> root@calih1 -nc calis1:22 "uname"
Looking up host "calih1"
Connecting to 130.200.29.235 port 22
Server version: SSH-2.0-OpenSSH_4.2p1-hpn
Using SSH protocol version 2
We claim version: SSH-2.0-PuTTY_Local:_Feb_16_2010_16:19:39
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-1
Host key fingerprint is:
ssh-rsa 2048 aa:b4:b8:f3:fb:f2:f1:84:15:82:93:ff:0e:52:99:c1
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Using username "root".
Access granted
Opening direct-tcpip channel to calis1:22 in place of session
Opened direct-tcpip channel
SSH-2.0-Sun_SSH_1.1
FYI, you didn't need to do this -- it's built automatically every night.
The resulting executables can be found on the Download page of the PuTTY
website.
>Now the command-line keeps on hanging after the last line .
>I was expecting the command to return with output of command run .
[...]
>C:\Ashish\Secure Library\putty-src\WINDOWS\MSVC\PLINK\Debug>plink.exe
> -v -pw <password> root@calis1 -nc calih1:22 "ls -l"
[...]
>Opening direct-tcpip channel to calih1:22 in place of session
>Opened direct-tcpip channel
>SSH-2.0-OpenSSH_4.2p1-hpn
It looks like you're expecting to make two SSH connections, one to
"calis1", and another through that to "calih1", which is presumably not
directly reachable. But for that you'd need two "plink" invocations, as
there is only ever at most one SSH connection per invocation of "plink";
what you've got here on your standard input is a raw TCP connection to
"calih1" port 22 -- the "SSH-2.0-OpenSSH_4.2p1-hpn" is the opening
dialogue of the SSH protocol.
Assuming I've guessed your intention correctly, you need a "plink"
invocation which itself invokes "plink calis1 -nc calih1:22" as a proxy
command. Currently the only way to do this is by having a saved session.
Say you create a session called "calih1". It needs the following
settings:
Host Name: calih1
Connection type: SSH
Proxy tab:
Proxy type: Local
Telnet command: "\path\to\plink.exe -pw %pass %user@%proxyhost
-nc %host:%port"
Proxy hostname: calis1
Proxy port: 22
Proxy username: root
Proxy password: <root@calis1's password>
(of course you could just embed all the proxy details in the command
line rather than using the %var expansions I've shown)
Having created this session, you should now be able to execute
plink calih1 "ls -l"
and get the results of running "ls -l" on calih1.