LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Black Screen PuTTY and SSH on Slackware 10 (https://www.linuxquestions.org/questions/slackware-14/black-screen-putty-and-ssh-on-slackware-10-a-264516/)

cummic 12-11-2004 03:21 PM

But I never get a login prompt when I do the telnet 192.168.0.99 22. I just get the connection host lost. How do I get a login prompt? Why can't I see when I type? I do have the newest version of puTTY.

cummic 12-11-2004 03:29 PM

when i go to my /var/log/messages file after i telnet it has this:

Dec 11 14:22:06 cm sshd[2038]: Bad protocol version identification ' ' from 192.168.0.98.

192.168.0.99 is the windows machine

shilo 12-11-2004 09:00 PM

Quote:

I never get a login prompt when I do the telnet 192.168.0.99 22
You shouldn't, and that's why you don't. This wasn't meant to get a connection, it was meant to see if a port was open. Hacker trick. Use telnet to attempt to login to different ports and evaluate their response. To help you out, here is what happens when I do something similar:

Code:

shilo@shilo2:~$ telnet 192.168.0.100 22
Trying 192.168.0.100...
Connected to 192.168.0.100.
Escape character is '^]'.
SSH-2.0-OpenSSH_3.9p1
shilo
Protocol mismatch.
Connection closed by foreign host.
shilo@shilo2:~$

Quote:

How do I get a login prompt?
If you are running a Telnet server, you can drop the port number, or change the port number to 23. Not that that really helps, since that is how to get a telnet connection.

The really strange thing is that your port scanner tells you that there are no open ports. Telnet tells you different. I may have missed it, but what type of router are you running? Possibly it is not configured properly. Are you running iptables on the Linux box? Posibly THAT is not configured properly.

On your Linux box, what is the output of:

Code:

nmap localhost
?

cummic 12-12-2004 12:26 PM

I am running a D-Link 614+. How do I set up iptables? The nmap command gives me this:

Interesting ports on localhost (127.0.0.1)
(The 1652 ports scanned but not shown below are in state: closes)
PORT STATE SERVICE
22/tcp open ssh
37/tcp open time
80/tcp open http
113/tcp open auth
139/tcp open netbios-ssn
445/tcp open microsoft-ds
3306/tcp open mysql

Nmap completed -- 1 IP address (1 host up) scanned in 0.740 seconds

mrcheeks 12-12-2004 12:59 PM

if you don't mind
man iptables

cummic 12-12-2004 01:19 PM

When I type man iptables the help file comes up. Is there anything that you want me to do?

Hangdog42 12-12-2004 02:45 PM

OK, it seems pretty obvious to me that the ssh daemon is screwed up. It is absolutetly the ONLY piece of this puzzle that hasn't been checked and found working or not a problem.

XP and Putty are OK since cummic can connect to other ssh servers
Nmap and netstat both show sshd listenting on port 22, so something is running, but there is no proof it works.
Log files don't even show an attempt at logging into ssh.
The linux firewall isn't an issue since there are no rules and all policies are set to ACCEPT (so this whole iptables discussion is a red herring)
The hardware doesn't appear to be an issue since cummic is running a web server that works (this also covers a problem with port forwarding)

So unless anybody has any better ideas, we should be focusing on the ssh daemon. About the only thing we haven't seen is the sshd_config file and I suppose something in there could be goofy. Otherwise my suggestion is a re-install of ssh.

cummic 12-12-2004 03:29 PM

I removed and re-installed the package from the slackware CD. Still no luck. The sshd_config has not been altered. It is exactly how it came with the slackware distribution.

Hangdog42 12-12-2004 03:49 PM

Dang. OK, two things. First, check your host.deny file. I know you said hosts.allow is empty, but if you never checked hosts.deny that may cause an issue. Second, If you'll email me how to connect to your server (IP address or domain) I'll see if I can get a login prompt. This is entirely optional and I DON"T want to log in. I'll just see if I can get a login prompt. You can email me with the button at the bottom of this post.

Cedrik 12-12-2004 03:50 PM

Are you sure you don't miss any mandatory option in putty to connect ?
Did you wait a long time before considering the connection has failed ?

shy 12-12-2004 03:53 PM

Quote:

I know you said hosts.allow is empty, but if you never checked hosts.deny that may cause an issue.
How can host.deny be the case if telnet successfully connected to 22nd port?

Hangdog42 12-12-2004 03:56 PM

Quote:

Originally posted by shy
How can host.deny be the case if telnet successfully connected to 22nd port?
Yeah, you're right. Oh well, another brilliant theory lost to the facts..........

Cedrik 12-12-2004 04:01 PM

You could try netfilter to see if connection established like

/sbin/iptables -A OUTPUT -o eth0 -d 192.168.0.98 \
-p tcp --sport 22 -j LOG --log-prefix "windows box out"

/sbin/iptables -A INPUT -i eth0 -s 192.168.0.98 \
-p tcp --dport 22 -j LOG --log-prefix "windows box in"

cummic 12-12-2004 04:13 PM

I typed:

/sbin/iptables -A OUTPUT -o eth0 -d 192.168.0.98 \
-p tcp --sport 22 -j LOG --log-prefix "windows box out"

and then i got the prompt

then I typed:
/sbin/iptables -A INPUT -o eth0 -s 192.168.0.98 \
-p tcp --dport 22 -j LOG --log-prefix "windows box in"

and it says can't use -o with INPUT.

I wait about ten minutes before I decide that I can't connect. I would rather not give the address out. All I can say is another linux box can connect and another xp box with puTTY cannot get a login prompt. I don't know what you mean by this:

Are you sure you don't miss any mandatory option in putty to connect ?

shilo 12-12-2004 04:13 PM

I'm still thinking this is a router issue. Nmap from the host shows the port open. Port scan from the from the XP box shows nothing. As a test, place the Slack box in the DMZ and see if that makes a difference.


All times are GMT -5. The time now is 12:21 AM.