Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
share|improve this question

3 Answers 3

up vote 1 down vote accepted

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
share|improve this answer
    
After login my log looks like this: 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 –  Eye of Hell Apr 13 '10 at 12:10
    
Added plink log to original question. –  Eye of Hell Apr 13 '10 at 12:19
    
Same error, but in verbose log 'bash: www.hostname.tk: command not found' now goes AFTER 'Server sent command exit status 127' O_O. This SSH eats my brain :(. –  Eye of Hell Apr 13 '10 at 13:15
    
I have found it. As always, "what have you done to your computer?" "Nothing!" "OMG, never do 'nothing' at your computer, it messes things up!". I just remembered that on a problem computer i have saved session in putty GUI to 'default'. And somehow this is messed up plink! After clearing 'hostname' for 'default' in putty GUI, all is working fine again O_O. –  Eye of Hell Apr 13 '10 at 13:26

well seeing as PC 1 Can connect using both its fair to say your server is still yp and running and isn't acting quirky.

If I was you I'd go digging on PC 2 see whats different from PC 1. New firewall updates, different firewall software ?

share|improve this answer
    
No changes at all :(. I have updates configured to 'manual', no installs for last week. –  Eye of Hell Apr 13 '10 at 10:13

I would suspect that something in /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile, /etc/bash.bashrc or ~/.bashrc is mistakenly executing $HOSTNAME as a command or the result of `hostname` or $(hostname). Look for one of those on a line by itself (or inside (an extra set of) backticks or $()). If this is the case, I have no idea why it would be this way on one client computer and not the other or what it would have to do with your installing Java.

share|improve this answer
    
I have carefullt checked specified files. No sign of hostnamez. Maybe it's possible to somehow log this issue? –  Eye of Hell Apr 13 '10 at 10:48
    
"...something in [list of files] is mistakenly executing..." or a file they call or source (ad infinitum) or /etc/ssh/sshrc or ~/.ssh/rc. –  Dennis Williamson Apr 13 '10 at 13:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.