Ubuntu – Weird problem with connection from putty to ubuntu server via SSH

puttyUbuntu

I have an Ubuntu Server 9.10 box with sshd configured. I have two computers with Windows 7 professional and putty installed. Day ago, both computers was able to connect ubuntu server both via putty and plink. I have installed sun-java6-jre on ubuntu server, and now have a weird problem. First Windows 7 computer can still connect with both putty GUI and command-line plink. Second computer can connect via putty gui, but if i issue plink command that works perfectly on first computer:

plink www.hostname.tk -i c:\users\username\documents\key\private.ppk

I get login prompt, enter same username as on first computer, and receive following weird error message:

bash: www.hostname.tk: command not found

I can't see any difference between my Windows 7 computers :(. The ppk key used is same (i copied it multiple times both ways). hostname and username are same. Anyone have any ideas why such thing happens and what can i do in order to troubleshoot and fix it?

Updated:

Log that plink -v disaplys:

Offered public key
Offer of public key accepted
Authenticating with public key "imported-openssh-key"
Access granted
Opened channel for session
Started a shell/command
bash: www.hostname.tk: command not found
Server sent command exit status 127
Disconnected: All channels closed

Best Answer

Can you try running plink -v and post that output?. Below I've changed the command to echo $PATH:

C:\Documents and Settings\dave>plink 10.0.1.1 -v /bin/echo $PATH
Looking up host "10.0.1.1"
Connecting to 10.0.1.1 port 22
Server version: SSH-2.0-OpenSSH_5.1p1 Debian-6ubuntu2
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-256
Host key fingerprint is:
ssh-rsa 2048 4a:84:5d:a8:a2:29:95:c0:4e:92:d1:38:68:e6:2b:5f
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
login as: dmo
dmo@10.0.1.1's password:
Sent password
Access granted
Opened channel for session
Started a shell/command
Server sent command exit status 0
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Disconnected: All channels closed