Cannot get SSH to work

If nothing works and you can afford that (I don’t know your lan) … you can try to remove the dsa/rsa keys in /etc/ssh and create new keys with ssh-keygen. I believe sshd does create some automatically the first time it runs. In that case, you would have to remove this server line from the ~/.ssh/known_hosts on your clients as well. But don’t to that if other people are connecting to that server !

I tried the verbose mode, but I can’t make anything out of this :'(:


primzy@OSUSE:~> 
primzy@OSUSE:~> ssh -v localhost
OpenSSH_5.4p1, OpenSSL 1.0.0 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to localhost ::1] port 22.
debug1: Connection established.
debug1: identity file /home/primzy/.ssh/id_rsa type -1
debug1: identity file /home/primzy/.ssh/id_rsa-cert type -1
debug1: identity file /home/primzy/.ssh/id_dsa type -1
debug1: identity file /home/primzy/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_5.4
debug1: match: OpenSSH_5.4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.4
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'localhost' is known and matches the RSA host key.
debug1: Found key in /home/primzy/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/primzy/.ssh/id_rsa
debug1: Trying private key: /home/primzy/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Password: 
debug1: Authentication succeeded (keyboard-interactive).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
login: Too many arguments
Try `login --help' or `login --usage' for more information.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to localhost closed.
Transferred: sent 1880, received 1936 bytes, in 0.0 seconds
Bytes per second: sent 130438.6, received 134324.0
debug1: Exit status 1

With netcat-openbsd installed I can connect two machines with NC, but not with SSH.

you can ssh successfully but got an error while loging in.
Can you create a new user on the server an try to ssh from a client with :
ssh -l thatUser server

  • according to the debug ouput in your previous post

Oh sorry … I you tried ‘ssh -vvv localhost’, that’s not even a server/client issue.
Do you see any error messages while typing ‘bash -l’ as user on the server ?

This is all I get:

primzy@OSUSE:~> bash -l
Directory: /home/primzy
Sun Sep  5 08:15:00 CEST 2010

SDB:Configure openSSH - openSUSE

Note a change here: SDB:Configure openSSH - openSUSE

PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys

I changed the sshd_config and restarted service, but no luck. I still have the same situation and error in /var/log/messeges:

Sep  5 09:06:23 OSUSE sshd[13746]: Accepted keyboard-interactive/pam for primzy from 192.168.4.222 port 1065 ssh2
Sep  5 09:06:23 OSUSE sshd[13746]: syslogin_perform_logout: logout() returned an error

:frowning:

I might be wrong … but I believe ssh is OK so far. The ssh connection has been established. But then you cannot login for some reason. Something is wrong in your environment, like a syntax error in one of the ~/.profile, ~/.bashrc /etc/profile or wherever else. This is why I suggested to create a new user and ssh as this user.
Would you please :
ls -la /etc/ssh
and
ls -la ~/.ssh

Here is the output for new user test and my testing user primzy:

test@OSUSE:/home/primzy> ls -la /etc/ssh/
total 184
drwxr-xr-x   3 root root   4096 2010-09-05 09:06 .
drwxr-xr-x 106 root root  12288 2010-09-05 09:30 ..
-rw-------   1 root root   1679 2010-09-05 00:40 key1
-rw-r--r--   1 root root    392 2010-09-05 00:40 key1.pub
-rw-------   1 root root 125811 2010-07-05 23:40 moduli
-rw-r--r--   1 root root   3059 2010-09-01 21:32 ssh_config
-rw-r-----   1 root root   3925 2010-09-05 09:06 sshd_config
-rw-------   1 root root    668 2010-09-05 00:44 ssh_host_dsa_key
-rw-r--r--   1 root root    605 2010-09-05 00:44 ssh_host_dsa_key.pub
-rw-------   1 root root    530 2010-09-05 00:44 ssh_host_key
-rw-r--r--   1 root root    334 2010-09-05 00:44 ssh_host_key.pub
-rw-------   1 root root    883 2010-09-05 00:44 ssh_host_rsa_key
-rw-r--r--   1 root root    225 2010-09-05 00:44 ssh_host_rsa_key.pub
drwxr-xr-x   2 root root   4096 2010-09-05 00:34 temp
test@OSUSE:/home/primzy> ls -la ~/.ssh 
ls: cannot access /home/test/.ssh: No such file or directory
test@OSUSE:/home/primzy> exit
exit
primzy@OSUSE:~> ls -la ~/.ssh 
total 12
drwx------  2 primzy users 4096 2010-09-05 00:19 .
drwxr-xr-x 32 primzy users 4096 2010-09-05 09:50 ..
-rw-r--r--  1 primzy users  540 2010-09-05 00:27 known_hosts


Can I add, I ran a test privately (PM) with the user and came up with the same error.

I suggested going back to original /etc/ssh config files and starting fresh.

And it worked. :smiley:
I don’t jet know what I did wrong. But I’m going to change line by line to find out where I went wrong.

thx for all your help

Just so everyone is clear. I gave primzy82 original ssh config files to re-do the set up.
And they PM’d me

It worked!!!
I don’t know what was wrong in my conf file, but I’m going to find out what’s the problem.
One of the differences from my file is this line:
Subsystem sftp /usr/lib64/ssh/sftp-server
Subsystem sftp /usr/lib/ssh/sftp-server

I used the second line, since my system isn’t 64 bit.

thx for or ur help http://forums-opensuse.provo.novell…/…/images/smiliesnew/smile.png

I finaly found what was the problem with my sshd_config:


< #UseLogin no
---
> UseLogin yes

If I use yes for parameter ssh does not work.

thanks for all the help

It’s difficult to see the wood for the trees sometimes.

Happy we helped a little anyway.

I told you it was a login problem. lol!