Cannot get SSH to work

Hi

I just did a fresh install of OPENSUSE 11.3. And I can’t connect to the machine via ssh.

I get the folowing error in /var/log/messages:
Sep 4 08:04:11 OSUSE sshd[10589]: Accepted keyboard-interactive/pam for primzy from 192.168.4.222 port 1042 ssh2
Sep 4 08:04:11 OSUSE sshd[10589]: syslogin_perform_logout: logout() returned an error

I found some ideas how to solve this but nothing seams to work.
One of the links was this one: link.
From this link I found out that I’m missins /etc/ttys file, But creating it did’n make any difference.

Here are some information on my system:
OSUSE:/etc # zypper lr -d

| Alias | Name | Enabled | Refresh | Priority | Type | URI | Service

–±------------------------------------±------------------------------------±--------±--------±---------±-------±----------------------------------------------------------------±-------
1 | Updates for openSUSE 11.3 11.3-1.82 | Updates for openSUSE 11.3 11.3-1.82 | Yes | Yes | 99 | rpm-md | Index of /update/11.3 |
2 | openSUSE-11.3 11.3-1.82 | openSUSE-11.3 11.3-1.82 | Yes | No | 99 | yast2 | cd:///?devices=/dev/sr0 |
3 | repo-debug | openSUSE-11.3-Debug | No | Yes | 99 | NONE | Index of /debug/distribution/11.3/repo/oss |
4 | repo-non-oss | openSUSE-11.3-Non-Oss | Yes | Yes | 99 | yast2 | Index of /distribution/11.3/repo/non-oss |
5 | repo-oss | openSUSE-11.3-Oss | Yes | Yes | 99 | yast2 | Index of /distribution/11.3/repo/oss |
6 | repo-source | openSUSE-11.3-Source | No | Yes | 99 | NONE | Index of /source/distribution/11.3/repo/oss |
OSUSE:/etc # uname -a
Linux OSUSE 2.6.34-12-default #1 SMP 2010-06-29 02:39:08 +0200 i686 athlon i386 GNU/Linux
OSUSE:/etc # rpm -qa | grep openssh
openssh-5.4p1-8.2.i586
openssh-askpass-5.4p1-8.2.i586

I hope someone knows a solution to this problem. :\

Regards,
Primzy

Don’t forget to turn on the ssh daemon and open port #22.

ssh daemon can be turned on under:
yast > system > system services (run level) > simple mode and change sshd to YES.

This may be a silly question, did you start ssh server.
/etc/init.d/sshd start

Edit: i am slow in typing, credit goes to oldcpu.

I forget to add this part:
OSUSE:/etc # netstat -anp|grep ssh
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 11916/sshd
tcp 0 0 :::22 :::* LISTEN 11916/sshd

When I try to connect and I give wrong password I get another canse to put in the password. But when I put in the correct password, I get disconected.
root@Router2:/tmp/home/root# ssh primzy@192.168.xxx.xxx
Login for primzy@192.168.xxx.xxx
Password:
Login for primzy@192.168.xxx.xxx
Password:
login: Too many arguments
Try login --help' or login --usage’ for more information.

Are you trying to login as root ? If so, do not try to login as root

no, I’m not trying to log in as root

Did you start the daemon as suggested? and open a port in your firewall as suggested?

What do you see if you type the following command on the server :
service sshd restart
?
Is port 22 blocked by the firewall ?
What’s in the files /etc/hosts.deny and /etc/hosts.allow ?

I disabled firewall. And SSH is answering at another computer, but it doesn’t let me pass password.

OSUSE:/etc # service sshd restart
Shutting down SSH daemon done
Starting SSH daemon done

/etc/hosts.deny

/etc/hosts.deny

See ‘man tcpd’ and ‘man 5 hosts_access’ as well as /etc/hosts.allow

for a detailed description.

http-rman : ALL EXCEPT LOCAL

In /etc/hosts.allow there are only comments. I have’t changed this files.

Did you try as a different user ?
(the user needs to have an account on the server running the ssh daemon).
If the user on the client has a file named ~/.ssh/known_hosts, rename this file for testing purpose and try to ssh again to the server.

I just tried to create new user test and I get the same error when trying to connect:
Sep 4 23:17:17 OSUSE sshd[14321]: Accepted keyboard-interactive/pam for test from 192.168.xxx.xxx port 2898 ssh2
Sep 4 23:17:17 OSUSE sshd[14321]: syslogin_perform_logout: logout() returned an error

I also tried to connecting from two different machines that I never used before but that didn’t help :frowning:

I assume both machines are using the same ssh protocol version ?

On the server side I have set “Protocol 2,1”.
On the client side I have tried both versions 1 and 2.

ssh -2 -4 serverIP (?)

What do you mean with this? :\

Can server and client chat together on port 22 ?

  1. zypper in netcat-openbsd *
  2. on the server, type:
nc -l 22
  1. on the client type
nc serverIP 22
  1. type some text in both terminals
  • I don’t know how to netcat to port 22 using Linux ‘netcat’, installed by default. I get a ‘protocol mismatch’. netcat to a random port is ok.

ssh to server using protocol 2 and IPV4

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

How have you customized your environment since you installed? For example
SSH may have an issue such as the one that rsync sees in the ‘is your
shell clean’ section of the following link:

http://samba.anu.edu.au/rsync/FAQ.html

It may not be that exactly, but perhaps something else in your environment
is causing the issue. Does it happen when you SSH to localhost from the
box itself? I assume it will. Turn up the verbosity of your messages:

ssh -vvv localhost

See what kind of goodness you see on the client side.

Good luck.

On 09/04/2010 03:36 PM, primzy82 wrote:
>
> I just tried to create new user test and I get the same error when
> trying to connect:
> Sep 4 23:17:17 OSUSE sshd[14321]: Accepted keyboard-interactive/pam
> for test from 192.168.xxx.xxx port 2898 ssh2
> Sep 4 23:17:17 OSUSE sshd[14321]: syslogin_perform_logout: logout()
> returned an error
>
> I also tried to connecting from two different machines that I never
> used before but that didn’t help :frowning:
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMgr8DAAoJEF+XTK08PnB5QNQP/0aI6cgDexDLIhokuvVzo/eU
DANUgyv5uZV71gnnsnqSIjzCs5qNsW+8aBeFGnv/M3xGBR3XbpN8E2GEt4eo+RB1
lCydMgtPhslGu+6PGYptaCi9VkijcEnPB+KSBdoNil1sbyn5mW0uKxhBeK1scfUq
1eWsSy8J51jYelJYCltzflchVCCJ9MWKqj3JDALw2APco6cxOta9L4GKoqLQhO92
wPS7Ua8yMSdZGJ1ny3sUKemmaVzv4AuSnU9hvvopIqi5VtliuP+IKUmQ9Q4KdLrj
UQ8YdSDqbjbkC6+Z62fD2rTH50EZDo0fyMdOb3AVoh6EJ1bNfwgvmbYBRKmKImky
RmdpISG/g1h/OwuGATyBr1IIi/XtOnWIKWbSjwoJ+Vv1FQswe9PWfLp4Qr33wjgk
ys3OHN4lBSAQ7bSTcZUoFstGmPYucdanCrRqUoOCU31T7SylpzkPETFmCC0JudL6
t2Nd8ozkf72Sf30Zf3Q057a+Y59hAWy31CuauxKspiiv+nx0I88Z4mJgQG0zqeHS
qT3qSIytugQKGftPAnizzCn1hIaw+TL4/d8YbSVnqy1F6QWYz8OqV+SPRy5CkkXE
7N5nq18YZ52RyWRbYrNyJtCTwt/iMQudyD5kiVEVWvic7JGZxFOsQlLYQU874en2
5GEctrBgRw4J7OdVjnoT
=/R8h
-----END PGP SIGNATURE-----

I tried this with netcat on opensuse and nc on router with linux based firmware and I got on the client(router):
nc 192.168.4.44 22
SSH-1.99-OpenSSH_5.4
ls
Protocol mismatch.

and nothing on server.

If I connect from XP with putty I use this protocol 2 and IPV4 by default.

I got a protocol mismatch using Linux netcat on openSUSE too. That’s why I suggested to install netcat-openbsd. This package contains the ‘nc’ command.

It doesn’t explain the mismatch error. I probably missed something.