Anzeige:
Ergebnis 1 bis 7 von 7

Thema: Bei SSH2 versuchen keine Passwort Abfrage zu bekommen

  1. #1
    Registrierter Benutzer Avatar von xmarvel
    Registriert seit
    Mar 2001
    Ort
    Berlin
    Beiträge
    372

    Bei SSH2 versuchen keine Passwort Abfrage zu bekommen

    hi all

    Ich versuch schon seid meheren HowTos und Manpages SSH2 dazu zu bringen das er kein Passwort verlangt wenn ich mich an meinen Client anmelde leider vergeblich
    Ich beschreibe mal wie ich es zur Zeit mache das Ziel ist das ich vom Server auf dem Client ohne Passwortabfrage connecten kann über ssh2:
    1. ich generiere mir auf dem Server 2 Schlüsselpaare mit "ssh-keygen -t rsa" bei der Passwortabfrage drück ich 2 mal Enter
    2. ich nehme mir den Schlüssel id_rsa.pub und kopiere ihn ins Verzeichniss /home//benutzer/.ssh auf dem Client und bennende diese Datei um auf authorized_keys
    3. nun versuch ich mich mit dem befehl ssh benutzer@client mich einzuloggen nur leider verlangt er immer noch nach dem Passwort


    Mein Distri ist auf beiden Rechnern RedHat 7.2 und die OpenSSH Version ist 3.1p1.
    Ich geb mal noch meine ssh_config aus :

    # $OpenBSD: ssh_config,v 1.12 2002/01/16 17:55:33 stevesk Exp $

    # This is the ssh client system-wide configuration file. See ssh(1)
    # for more information. This file provides defaults for users, and
    # the values can be changed in per-user configuration files or on the
    # command line.

    # Configuration data is parsed as follows:
    # 1. command line options
    # 2. user-specific file
    # 3. system-wide file
    # Any configuration value is only changed the first time it is set.
    # Thus, host-specific definitions should be at the beginning of the
    # configuration file, and defaults at the end.

    # Site-wide defaults for various options

    # Host *
    # ForwardAgent no
    # ForwardX11 no
    # RhostsAuthentication yes
    # RhostsRSAAuthentication yes
    # RSAAuthentication yes
    # PasswordAuthentication yes
    # FallBackToRsh no
    # UseRsh no
    # BatchMode no
    # CheckHostIP yes
    # StrictHostKeyChecking ask
    # IdentityFile ~/.ssh/identity
    # IdentityFile ~/.ssh/id_rsa
    # IdentityFile ~/.ssh/id_dsa
    # Port 22
    # Protocol 2,1
    # Cipher 3des
    # Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
    # EscapeChar ~
    Host *
    ForwardX11 yes



    und die sshd_config



    # $OpenBSD: sshd_config,v 1.48 2002/02/19 02:50:59 deraadt Exp $

    # This is the sshd server system-wide configuration file. See sshd(8)
    # for more information.

    # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

    # The strategy used for options in the default sshd_config shipped with
    # OpenSSH is to specify options with their default value where
    # possible, but leave them commented. Uncommented options change a
    # default value.

    #Port 22
    #Protocol 2,1
    #ListenAddress 0.0.0.0
    #ListenAddress ::

    # HostKey for protocol version 1
    #HostKey /etc/ssh/ssh_host_key
    # HostKeys for protocol version 2
    #HostKey /etc/ssh/ssh_host_rsa_key
    #HostKey /etc/ssh/ssh_host_dsa_key

    # Lifetime and size of ephemeral version 1 server key
    #KeyRegenerationInterval 3600
    #ServerKeyBits 768

    # Logging
    #obsoletes QuietMode and FascistLogging
    #SyslogFacility AUTH
    SyslogFacility AUTHPRIV
    #LogLevel INFO

    # Authentication:

    #LoginGraceTime 600
    #PermitRootLogin yes
    #StrictModes yes

    #RSAAuthentication yes
    #PubkeyAuthentication yes
    #AuthorizedKeysFile .ssh/authorized_keys

    # rhosts authentication should not be used
    #RhostsAuthentication no
    # Don't read the user's ~/.rhosts and ~/.shosts files
    #IgnoreRhosts yes
    # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
    #RhostsRSAAuthentication no
    # similar for protocol version 2
    #HostbasedAuthentication no
    # Change to yes if you don't trust ~/.ssh/known_hosts for
    # RhostsRSAAuthentication and HostbasedAuthentication
    #IgnoreUserKnownHosts no

    # To disable tunneled clear text passwords, change to no here!
    #PasswordAuthentication yes
    #PermitEmptyPasswords no

    # Change to no to disable s/key passwords
    #ChallengeResponseAuthentication yes

    # Kerberos options
    # KerberosAuthentication automatically enabled if keyfile exists
    #KerberosAuthentication yes
    #KerberosOrLocalPasswd yes
    #KerberosTicketCleanup yes

    # AFSTokenPassing automatically enabled if k_hasafs() is true
    #AFSTokenPassing yes

    # Kerberos TGT Passing only works with the AFS kaserver
    #KerberosTgtPassing no

    # Set this to 'yes' to enable PAM keyboard-interactive authentication
    # Warning: enabling this may bypass the setting of 'PasswordAuthentication'
    #PAMAuthenticationViaKbdInt yes

    #X11Forwarding no
    X11Forwarding yes
    #X11DisplayOffset 10
    #X11UseLocalhost yes
    #PrintMotd yes
    #PrintLastLog yes
    #KeepAlive yes
    #UseLogin no

    #MaxStartups 10
    # no default banner path
    #Banner /some/path
    #VerifyReverseMapping no

    # override default of no subsystems
    Subsystem sftp /usr/libexec/openssh/sftp-server

  2. #2
    -
    Registriert seit
    Feb 2001
    Beiträge
    337
    #PubkeyAuthentication yes
    #AuthorizedKeysFile .ssh/authorized_keys

    mal in

    PubkeyAuthentication yes
    AuthorizedKeysFile .ssh/authorized_keys

    ändern und den sshd neustarten. Ausserdem musst du den private key auf deinem lokalen rechner im ~/.ssh und, wie du schon geschrieben hast, auch den pub key auf dem remote host haben.

    z.

  3. #3
    Registrierter Benutzer Avatar von xmarvel
    Registriert seit
    Mar 2001
    Ort
    Berlin
    Beiträge
    372
    leider funktioniert das immer noch nicht ):
    ich schreib mal hier hin was beim Debugen rauskommt.

    OpenSSH_3.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090602f
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug1: Rhosts Authentication disabled, originating port will not be trusted.
    debug1: restore_uid
    debug1: ssh_connect: getuid 500 geteuid 0 anon 1
    debug1: Connecting to 127.0.0.1 [127.0.0.1] port 22.
    debug1: temporarily_use_uid: 500/500 (e=0)
    debug1: restore_uid
    debug1: temporarily_use_uid: 500/500 (e=0)
    debug1: restore_uid
    debug1: Connection established.
    debug1: read PEM private key done: type DSA
    debug1: read PEM private key done: type RSA
    debug1: identity file /home/xmarvel/.ssh/identity type -1
    debug3: Not a RSA1 key file /home/xmarvel/.ssh/id_rsa.
    debug2: key_type_from_name: unknown key type '-----BEGIN'
    debug3: key_read: no key found
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug3: key_read: no space
    debug2: key_type_from_name: unknown key type '-----END'
    debug3: key_read: no key found
    debug1: identity file /home/xmarvel/.ssh/id_rsa type 1
    debug1: identity file /home/xmarvel/.ssh/id_dsa type -1
    debug1: Remote protocol version 1.99, remote software version OpenSSH_3.1p1
    debug1: match: OpenSSH_3.1p1 pat OpenSSH*
    Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_3.1p1
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none
    debug2: kex_parse_kexinit: none
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib
    debug2: kex_parse_kexinit: none,zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: mac_init: found hmac-md5
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug2: mac_init: found hmac-md5
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
    debug1: dh_gen_key: priv key bits set: 129/256
    debug1: bits set: 1647/3191
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug3: check_host_in_hostfile: filename /home/xmarvel/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug1: Host '127.0.0.1' is known and matches the RSA host key.
    debug1: Found key in /home/xmarvel/.ssh/known_hosts:1
    debug1: bits set: 1559/3191
    debug1: ssh_rsa_verify: signature correct
    debug1: kex_derive_keys
    debug1: newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: waiting for SSH2_MSG_NEWKEYS
    debug1: newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: done: ssh_kex2.
    debug1: send SSH2_MSG_SERVICE_REQUEST
    debug1: service_accept: ssh-userauth
    debug1: got SSH2_MSG_SERVICE_ACCEPT
    debug1: authentications that can continue: publickey,password,keyboard-interactive
    debug3: start over, passed a different list publickey,password,keyboard-interactive
    debug3: preferred publickey,keyboard-interactive,password
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: next auth method to try is publickey
    debug1: try privkey: /home/xmarvel/.ssh/identity
    debug3: no such identity: /home/xmarvel/.ssh/identity
    debug1: try pubkey: /home/xmarvel/.ssh/id_rsa
    debug3: send_pubkey_test
    debug2: we sent a publickey packet, wait for reply
    debug1: authentications that can continue: publickey,password,keyboard-interactive
    debug1: try privkey: /home/xmarvel/.ssh/id_dsa
    debug3: no such identity: /home/xmarvel/.ssh/id_dsa
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup keyboard-interactive
    debug3: remaining preferred: password
    debug3: authmethod_is_enabled keyboard-interactive
    debug1: next auth method to try is keyboard-interactive
    debug2: userauth_kbdint
    debug2: we sent a keyboard-interactive packet, wait for reply
    debug1: authentications that can continue: publickey,password,keyboard-interactive
    debug3: userauth_kbdint: disable: no info_req_seen
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup password
    debug3: remaining preferred:
    debug3: authmethod_is_enabled password
    debug1: next auth method to try is password


    ich probier das erstmal lokal aus wie man sieht sollte ja nix anderes sein.

    MFG
    xmarvel

  4. #4
    Registrierter Benutzer Avatar von xmarvel
    Registriert seit
    Mar 2001
    Ort
    Berlin
    Beiträge
    372
    vielleicht kann ja jemand seine Config Files mal posten wo es funktioniert da ich denke das dort irgendwas falsch sein muss.

  5. #5
    Moderator Avatar von taylor
    Registriert seit
    Dec 2000
    Ort
    Mannheim
    Beiträge
    5.618
    Ich behaupte mal, es liegt weniger am config-file als am *KEY*

    Genauer: SSH2 möchte ein DSA Schlüsselpaar, SSH1 ein RSA

    Falls noch nicht geschehen, erstelle mal DSA Keys mit
    'ssh-keygen -t dsa' (leere Passphrase selbstverständlich)

    Dann heisst der Schlüssel auch nicht ~/.ssh/identity sondern ~/.ssh/id_dsa

    Evtl. musst Du dann beim login noch Parameter mitgeben, oder natörlich /etc/ssh/ssh_config anpassen:

    ssh -2 -i ~/.ssh/id_dsa user@server

    Gruß und HTH,
    Taylor


    PS: Wie gesagt, ich *behaupte* ;-)

  6. #6
    Registrierter Benutzer
    Registriert seit
    Oct 2001
    Ort
    Rosstal
    Beiträge
    149
    ssh2 macht auch rsa

    wenn du ssh1 machen willst musst du -t rsa1 angeben

    ich selber benutze ssh2 mit rsa

  7. #7
    Registrierter Benutzer Avatar von pitu
    Registriert seit
    May 1999
    Ort
    Nürnberg
    Beiträge
    1.765
    ssh-keygen -t rsa hast du ja schon, du solltest noch folgendes machen:

    ssh-keygen -t dsa
    ssh-keygen -t rsa1

    in der configuration solltest du noch Protocol 2,1 aktivieren

    hier die konfiguration auf der SuSE 8.0:
    Code:
    Port 22
    HostKey /etc/ssh/ssh_host_key
    HostKey /etc/ssh/ssh_host_rsa_key
    HostKey /etc/ssh/ssh_host_dsa_key
    KeyRegenerationInterval 3600
    ServerKeyBits 768
    SyslogFacility AUTH
    LogLevel INFO
    LoginGraceTime 600
    PermitRootLogin yes
    StrictModes yes
    RSAAuthentication yes
    PubkeyAuthentication yes
    RhostsAuthentication no
    IgnoreRhosts yes
    RhostsRSAAuthentication no
    HostbasedAuthentication no
    PasswordAuthentication yes
    PermitEmptyPasswords no
    ChallengeResponseAuthentication no
    X11Forwarding yes
    X11DisplayOffset 10
    PrintMotd yes
    KeepAlive yes
    Subsystem       sftp    /usr/lib/ssh/sftp-server
    gruss,
    pitu
    11 Fehler in Windows, 88 Loesungen, 0 funktionieren.

    Dieser Beitrag steht unter der GNU Free Documentation License.

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •