Partage
  • Partager sur Facebook
  • Partager sur Twitter

mot de passe server ssh

    29 août 2015 à 16:45:07

    bonjour a tous!

    je suis le tutoriel "reprendre le controle a l'aide de linux!" sur la connexion a distance avec openssh-server, au moment de la question si je veux continuer je mets "yes" mais quand il faut rentrer le mot de passe , je n'arrive pas:

    dois-je rentrer le mot de passe utilisateur ou un autre, et ou puis-je le trouver ou le réinitialiser?

    merci d'avance

    thomas

    • Partager sur Facebook
    • Partager sur Twitter
      29 août 2015 à 17:23:27

      Il faut rentrer le mot de passe de l'utilisateur en tant que lequel tu veux te connecter. Pour réinitialiser le mot de passe d'un utilisateur, regarde du côté de la commande passwd (à utiliser en tant que root ou utilisateur concerné).

      • Partager sur Facebook
      • Partager sur Twitter
      Envie de mettre les mains dans le cambouis ? Passez à Funtoo GNU/Linux. DO IT!
        30 août 2015 à 12:20:21

        merci pour vos réponse.

        du coup j'ai tenté avec le bon mot de passe mais le serveur me renvois: "Permission denied (publickey,password)." alors que je suis connecté sur la même wifi avec deux ordi sous ubuntu.

        • Partager sur Facebook
        • Partager sur Twitter
          30 août 2015 à 12:56:32

          Peut-on voir la configuration sshd de la machine distante ? /etc/ssh/sshd_config. Ainsi que les logs de connexion de la machine distante ? /var/log/auth.log.

          En particulier, il est possible que le StrictModes soit activé.

          man 5 sshd_config

           StrictModes
                   Specifies whether sshd(8) should check file modes and ownership of the user's files and home
                   directory before accepting login.  This is normally desirable because novices sometimes
                   accidentally leave their directory or files world-writable.  The default is “yes”.  Note
                   that this does not apply to ChrootDirectory, whose permissions and ownership are checked
                   unconditionally.
          

          S'il est activé, assure-toi que ton home directory est bien en 755.

          -
          Edité par PyTony 30 août 2015 à 13:04:31

          • Partager sur Facebook
          • Partager sur Twitter
          Envie de mettre les mains dans le cambouis ? Passez à Funtoo GNU/Linux. DO IT!
            30 août 2015 à 15:48:16

            salut PyTony!

            oui en effet le StrictModes est activé mais je ne sais pas comment savoir pour mon home directory car je ne sais pas ce que sais...

            j'ai voulu changé le strictmodes mais ca na rien donné peut-être que je ne sais pas faire:

            pour le changer j'ai ouvert "sshd_config" avec nano  puis j'ai modifier le strictmode puis j'ai enregistrer :/

            merci d'avance ;)

            -
            Edité par laativaa 30 août 2015 à 15:50:01

            • Partager sur Facebook
            • Partager sur Twitter
              30 août 2015 à 16:03:39

              Tu as mis StrictModes no ? Il faut sûrement recharger le service sshd après (Genre /etc/init.d/sshd reload).

              Il vaut mieux éviter de désactiver le StrictModes, à moins que tu ne sois sûr de ce que tu fais en n'ayant pas un home directory en 755.

              Mais ce n'est peut être pas le problème, c'est juste une possibilité. Le mieux est de nous montrer le /etc/ssh/sshd_config et le résultat de tail -n15 /var/log/auth.log.

              • Partager sur Facebook
              • Partager sur Twitter
              Envie de mettre les mains dans le cambouis ? Passez à Funtoo GNU/Linux. DO IT!
                30 août 2015 à 17:16:56

                tom@tom-ThinkPad-R400:~$ cat /etc/ssh/sshd_config

                # Package generated configuration file

                # See the sshd_config(5) manpage for details

                # What ports, IPs and protocols we listen for

                Port 22

                # Use these options to restrict which interfaces/protocols sshd will bind to

                #ListenAddress ::

                #ListenAddress 0.0.0.0

                Protocol 2

                # HostKeys for protocol version 2

                HostKey /etc/ssh/ssh_host_rsa_key

                HostKey /etc/ssh/ssh_host_dsa_key

                HostKey /etc/ssh/ssh_host_ecdsa_key

                HostKey /etc/ssh/ssh_host_ed25519_key

                #Privilege Separation is turned on for security

                UsePrivilegeSeparation yes

                # Lifetime and size of ephemeral version 1 server key

                KeyRegenerationInterval 3600

                ServerKeyBits 1024

                # Logging

                SyslogFacility AUTH

                LogLevel INFO

                # Authentication:

                LoginGraceTime 120

                PermitRootLogin without-password

                StrictModes yes

                RSAAuthentication yes

                PubkeyAuthentication yes

                #AuthorizedKeysFile %h/.ssh/authorized_keys

                # 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_known_hosts

                RhostsRSAAuthentication no

                # similar for protocol version 2

                HostbasedAuthentication no

                # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication

                #IgnoreUserKnownHosts yes

                # To enable empty passwords, change to yes (NOT RECOMMENDED)

                PermitEmptyPasswords no

                # Change to yes to enable challenge-response passwords (beware issues with

                # some PAM modules and threads)

                ChallengeResponseAuthentication no

                # Change to no to disable tunnelled clear text passwords

                #PasswordAuthentication yes

                # Kerberos options

                #KerberosAuthentication no

                #KerberosGetAFSToken no

                #KerberosOrLocalPasswd yes

                #KerberosTicketCleanup yes

                # GSSAPI options

                #GSSAPIAuthentication no

                #GSSAPICleanupCredentials yes

                X11Forwarding yes

                X11DisplayOffset 10

                PrintMotd no

                PrintLastLog yes

                TCPKeepAlive yes

                #UseLogin no

                #MaxStartups 10:30:60

                #Banner /etc/issue.net

                # Allow client to pass locale environment variables

                AcceptEnv LANG LC_*

                Subsystem sftp /usr/lib/openssh/sftp-server

                # Set this to 'yes' to enable PAM authentication, account processing,

                # and session processing. If this is enabled, PAM authentication will

                # be allowed through the ChallengeResponseAuthentication and

                # PasswordAuthentication. Depending on your PAM configuration,

                # PAM authentication via ChallengeResponseAuthentication may bypass

                # the setting of "PermitRootLogin without-password".

                # If you just want the PAM account and session checks to run without

                # PAM authentication, then enable this but set PasswordAuthentication

                # and ChallengeResponseAuthentication to 'no'.

                UsePAM yes

                tom@tom-ThinkPad-R400:~$

                ttom@tom-ThinkPad-R400:~$ tail -n15 /var/log/auth.log

                Aug 30 15:30:12 tom-ThinkPad-R400 sudo: tom : TTY=pts/10 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/bin/nano sshd_config

                Aug 30 15:30:12 tom-ThinkPad-R400 sudo: pam_unix(sudo:session): session opened for user root by tom(uid=0)

                Aug 30 15:31:08 tom-ThinkPad-R400 sudo: pam_unix(sudo:session): session closed for user root

                Aug 30 15:31:10 tom-ThinkPad-R400 sudo: tom : TTY=pts/10 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/bin/nano sshd_config

                Aug 30 15:31:10 tom-ThinkPad-R400 sudo: pam_unix(sudo:session): session opened for user root by tom(uid=0)

                Aug 30 15:32:05 tom-ThinkPad-R400 sudo: pam_unix(sudo:session): session closed for user root

                Aug 30 15:32:40 tom-ThinkPad-R400 sudo: tom : TTY=pts/10 ; PWD=/etc/ssh ; USER=root ; COMMAND=/bin/chmod u+rw sshd_config

                Aug 30 15:32:40 tom-ThinkPad-R400 sudo: pam_unix(sudo:session): session opened for user root by tom(uid=0)

                Aug 30 15:32:40 tom-ThinkPad-R400 sudo: pam_unix(sudo:session): session closed for user root

                Aug 30 15:39:54 tom-ThinkPad-R400 sudo: tom : TTY=pts/10 ; PWD=/etc/ssh ; USER=root ; COMMAND=/bin/cat ssh_host_dsa_key

                Aug 30 15:39:54 tom-ThinkPad-R400 sudo: pam_unix(sudo:session): session opened for user root by tom(uid=0)

                Aug 30 15:39:54 tom-ThinkPad-R400 sudo: pam_unix(sudo:session): session closed for user root

                Aug 30 16:17:01 tom-ThinkPad-R400 CRON[7558]: pam_unix(cron:session): session opened for user root by (uid=0)

                Aug 30 16:17:01 tom-ThinkPad-R400 CRON[7558]: pam_unix(cron:session): session closed for user root

                Aug 30 16:25:42 tom-ThinkPad-R400 polkitd(authority=local): Operator of unix-session:c1 successfully authenticated as unix-user:tom to gain TEMPORARY authorization for action org.debian.apt.install-or-remove-packages for system-bus-name::1.121 [/usr/bin/python /usr/bin/session-installer] (owned by unix-user:tom)

                tom@tom-ThinkPad-R400:~$

                • Partager sur Facebook
                • Partager sur Twitter
                  30 août 2015 à 17:29:28

                  Je ne vois pas de ligne ressemblant à "sshd: Authentication refused" dans les logs. Tu as essayé de te connecter récemment ? tom-ThinkPad-R400 est bien la machine distante sur laquelle tu essaies de te connecter ?

                  Quels sont les droits sur ton home directory ?

                  -
                  Edité par PyTony 30 août 2015 à 17:30:06

                  • Partager sur Facebook
                  • Partager sur Twitter
                  Envie de mettre les mains dans le cambouis ? Passez à Funtoo GNU/Linux. DO IT!
                    1 septembre 2015 à 11:15:15

                    Tu utilises PAM avec SSH, donc a priori le configuration de PAM passe avant celle de SSH.

                    Tu peux mettre UsePAM à no et réessayer ?

                    • Partager sur Facebook
                    • Partager sur Twitter

                    mot de passe server ssh

                    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
                    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
                    • Editeur
                    • Markdown