Ssh ce coupe toutes les 20min environ

Oui, c’est plutôt important mais vu qu’il ne semble pas y avoir de solution je vais peut-être y venir.

Merci pour votre aide.

1 « J'aime »

En fait il y as toujours deux méthodes lorsque tu as un problème:
-soit tu tente de le résoudre (comme toi :wink:) = très bien (c très formateur :+1:)
-soit tu réinstalle tout directement (méthode des gros bourin) = tres mauvais
Après tout toi tu as déjà essayé (mais bon c toujours gratifiant de réussir à résoudre son problème)

1 « J'aime »

Et puis comme dit le proverbe:

« Il y a toujours des problèmes aux solutions il faut juste les trouver »

une autre hypothèse : un problème de timeout sur le TCP pour y remédier la solution serait de modifier la config ssh du client (sur le PC debian)
pour se faire un faut modifier :
/etc/ssh/ssh_config
et
retire le # de la ligne #ConnectTimeout=0 et lui mettre ( pour une heure en seconde )
ConnectTimeout=3600

source man ssh_config

extrait :

ConnectTimeout
             Specifies the timeout (in seconds) used when connecting to the
             SSH server, instead of using the default system TCP timeout.
             This value is used only when the target is down or really
             unreachable, not when it refuses the connection

a noter que le keepalive sur le Rpi avec buster est de 7200 sec ( 2Hrs) mais je suspecte les développeurs de ssh de l’avoir modifier pour des raison de sécurité …
source :

1 « J'aime »

Bonjour,

Perso, je ne crois pas trop beaucoup à un problème de ssh.
Quels sont les messages d’erreur?
Qu’y a t-il d’autre d’installé sur cette machine?
Quand ssh s’arrête est ce qu’un programme est lancé par ssh dans le terminal client ?

  • Pour avoir plus d’infos, est-il possible de passer cette seulement cette commande à partir du client et d’attendre la coupure ?
    ssh -vvv user@rpi

  • Est-il possible de se connecter en ssh sur le PI lui même dans un terminal ? Passer la même commande et attendre 20 min…

Quels sont les messages d’erreur/de déconnection ?

A+

1 « J'aime »

Bonjour,

Merci pour vos réponses.

@bof Cela me semble peux probable car le processus ssh ce fait killer sur le serveur. J’ai quand même essayé mais rien y fait.

@jelopo

C’est un serveur nextcloud, donc apache mariadb php …

Le serveur ssh peut s’arrêter même si il y a rien dans le terminal client.

Voici le retour de ssh -vvv pi@… après la coupure.

pi@home-cloud:~$ debug3: send packet: type 1
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i0/0 o0/0 e[write]/0 fd 5/7/8 sock -1 cc -1)

debug3: fd 1 is not O_NONBLOCK
Connection to 192.168.1.36 closed by remote host.
Connection to 192.168.1.36 closed.
Transferred: sent 3324, received 3020 bytes, in 476.0 seconds
Bytes per second: sent 7.0, received 6.3
debug1: Exit status -1

Et voici les logs de ssh :

avril 15 10:07:55  sudo[3854]:     root : TTY=tty1 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/apt purge openssh-server -y
avril 15 10:08:14  userdel[4242]: delete user 'sshd'
avril 15 10:08:17  sudo[4283]:     root : TTY=tty1 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/apt install openssh-server -y
avril 15 10:08:26  useradd[4453]: new user: name=sshd, UID=107, GID=65534, home=/run/sshd, shell=/usr/sbin/nologin
avril 15 10:08:27  usermod[4460]: change user 'sshd' password
avril 15 10:08:27  chage[4466]: changed password expiry for sshd
avril 15 10:08:31  sshd[4575]: Server listening on 0.0.0.0 port 22.
avril 15 10:08:31  sshd[4575]: Server listening on :: port 22.
avril 15 10:13:04  sshd[4716]: Connection closed by 192.168.1.78 port 53144 [preauth]
avril 15 10:15:28  sshd[4734]: Accepted password for pi from 192.168.1.78 port 53220 ssh2
avril 15 10:15:28  sshd[4734]: pam_unix(sshd:session): session opened for user pi by (uid=0)
avril 15 10:30:32  systemd[1]: ssh.service: Main process exited, code=killed, status=9/KILL
avril 15 10:30:32  systemd[1]: ssh.service: Failed with result 'signal'.
avril 15 10:30:32  systemd[1]: ssh.service: Service RestartSec=100ms expired, scheduling restart.
avril 15 10:30:32  systemd[1]: ssh.service: Scheduled restart job, restart counter is at 1.
avril 15 10:30:32  sshd[4895]: /etc/ssh/sshd_config line 84: Unsupported option UsePAM
avril 15 10:30:32  sshd[4895]: Could not load host key: /etc/ssh/ssh_host_rsa_key
avril 15 10:30:32  sshd[4895]: Could not load host key: /etc/ssh/ssh_host_dsa_key
avril 15 10:30:32  sshd[4895]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
avril 15 10:30:32  sshd[4895]: Disabling protocol version 2. Could not load host key
avril 15 10:30:32  sshd[4895]: sshd: no hostkeys available -- exiting.
avril 15 10:30:32  systemd[1]: ssh.service: Control process exited, code=exited, status=1/FAILURE
avril 15 10:30:32  systemd[1]: ssh.service: Failed with result 'exit-code'.
avril 15 10:30:32  systemd[1]: ssh.service: Service RestartSec=100ms expired, scheduling restart.
avril 15 10:30:32  systemd[1]: ssh.service: Scheduled restart job, restart counter is at 2.
avril 15 10:30:32  sshd[4918]: /etc/ssh/sshd_config line 84: Unsupported option UsePAM
avril 15 10:30:32  sshd[4918]: Could not load host key: /etc/ssh/ssh_host_rsa_key
avril 15 10:30:32  sshd[4918]: Could not load host key: /etc/ssh/ssh_host_dsa_key
avril 15 10:30:32  sshd[4918]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
avril 15 10:30:32  sshd[4918]: Disabling protocol version 2. Could not load host key
avril 15 10:30:32  sshd[4918]: sshd: no hostkeys available -- exiting.
avril 15 10:30:32  systemd[1]: ssh.service: Control process exited, code=exited, status=1/FAILURE
vril 15 10:30:32   systemd[1]: ssh.service: Failed with result 'exit-code'.
avril 15 10:30:32  systemd[1]: ssh.service: Service RestartSec=100ms expired, scheduling restart.
avril 15 10:30:32  systemd[1]: ssh.service: Scheduled restart job, restart counter is at 3.
avril 15 10:30:32  sshd[4927]: /etc/ssh/sshd_config line 84: Unsupported option UsePAM
avril 15 10:30:32  sshd[4927]: Could not load host key: /etc/ssh/ssh_host_rsa_key
avril 15 10:30:32  sshd[4927]: Could not load host key: /etc/ssh/ssh_host_dsa_key
avril 15 10:30:32  sshd[4927]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
avril 15 10:30:32  sshd[4927]: Disabling protocol version 2. Could not load host key
avril 15 10:30:32  sshd[4927]: sshd: no hostkeys available -- exiting.
avril 15 10:30:33  systemd[1]: ssh.service: Control process exited, code=exited, status=1/FAILURE
avril 15 10:30:33  systemd[1]: ssh.service: Failed with result 'exit-code'.
avril 15 10:30:33  systemd[1]: ssh.service: Service RestartSec=100ms expired, scheduling restart.
avril 15 10:30:33  systemd[1]: ssh.service: Scheduled restart job, restart counter is at 4.
avril 15 10:30:33  sshd[4941]: /etc/ssh/sshd_config line 84: Unsupported option UsePAM
avril 15 10:30:33  sshd[4941]: Could not load host key: /etc/ssh/ssh_host_rsa_key
avril 15 10:30:33  sshd[4941]: Could not load host key: /etc/ssh/ssh_host_dsa_key
avril 15 10:30:33  sshd[4941]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
avril 15 10:30:33  sshd[4941]: Disabling protocol version 2. Could not load host key
avril 15 10:30:33  sshd[4941]: sshd: no hostkeys available -- exiting.
avril 15 10:30:33  systemd[1]: ssh.service: Control process exited, code=exited, status=1/FAILURE
avril 15 10:30:33  systemd[1]: ssh.service: Failed with result 'exit-code'.
avril 15 10:30:33  systemd[1]: ssh.service: Service RestartSec=100ms expired, scheduling restart.
avril 15 10:30:33  systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
avril 15 10:30:33  sshd[4957]: /etc/ssh/sshd_config line 84: Unsupported option UsePAM
avril 15 10:30:33  sshd[4957]: Could not load host key: /etc/ssh/ssh_host_rsa_key
avril 15 10:30:33  sshd[4957]: Could not load host key: /etc/ssh/ssh_host_dsa_key
avril 15 10:30:33  sshd[4957]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
avril 15 10:30:33  sshd[4957]: Disabling protocol version 2. Could not load host key
avril 15 10:30:33  sshd[4957]: sshd: no hostkeys available -- exiting.
avril 15 10:30:33  systemd[1]: ssh.service: Control process exited, code=exited, status=1/FAILURE
avril 15 10:30:33  systemd[1]: ssh.service: Failed with result 'exit-code'.
avril 15 10:30:33  systemd[1]: ssh.service: Service RestartSec=100ms expired, scheduling restart.
avril 15 10:30:33  systemd[1]: ssh.service: Failed with result 'exit-code'.
avril 15 10:30:33  systemd[1]: ssh.service: Service RestartSec=100ms expired, scheduling restart.
avril 15 10:30:33  systemd[1]: ssh.service: Scheduled restart job, restart counter is at 6.
avril 15 10:30:33  systemd[1]: ssh.service: Start request repeated too quickly.
avril 15 10:30:33  systemd[1]: ssh.service: Failed with result 'exit-cod

Merci pour votre aide

1 « J'aime »

Bonjour,

Sur le client, on voit que la connecxion est coupée par le serveur

Sur le serveur il semblerait que le processus sshd est killé par un kill -9.

C’est fort surpenant que ssh s’auto kill ! Je ne vois pas quel processus irait tuer sshd surtout si il n’y a pas d’activité.

La session à été tuée à 10:30, relancer plusieurs fois la manip et essayer de voir l’heure de coupure des sessions et si il n’y a pas une tâche en crontab qui tourne à la même heure.

De façon temporaire, éventuellement arrêter les tâches cron pour diagnostique:

     sudo systemctl stop cron

Est-ce que des script particuliers ont été installés ?

A+

1 « J'aime »

Bonjour,

J’ai désactivé cron, mais le problème persiste.

J’ai pas grand chose d’installé mis à part : apache, mariadb, php…, certbot(certificat ssl) j’avais installé fail2ban mais je l’ai enlevé pour les test. Un service tor (que j’ai installé après le problème ssh), compoer pour php.

Merci encore pour le temps que vous passer sur mon problème.

1 « J'aime »

Bonjour,

Quels sont les résultats de chacune de ces commandes ?

cat /etc/os-release
grep -v "^#" /etc/apt/sources.list
grep -v "^#" /etc/apt/sources.list.d/*
dpkg -l openssh*
grep -vE "^#|^$" /etc/ssh/sshd_config

A+

re Bonjour,

Voici les différents résultats :

cat /etc/os-release :

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

grep -v « ^# » /etc/apt/sources.list :

deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

grep -v « ^# » /etc/apt/sources.list.d/ :

/etc/apt/sources.list.d/docker.list:deb [arch=armhf] https://download.docker.com/linux/raspbian buster stable
/etc/apt/sources.list.d/raspi.list:deb http://archive.raspberrypi.org/debian/ buster main

dpkg -l openssh*

Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=attend-traitement-déclenchements
|/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais)
||/ Nom                 Version            Architecture Description
+++-===================-==================-============-===========================================================================
ii  openssh-client      1:7.9p1-10+deb10u2 armhf        secure shell (SSH) client, for secure access to remote machines
ii  openssh-server      1:7.9p1-10+deb10u2 armhf        secure shell (SSH) server, for secure access from remote machines
ii  openssh-sftp-server 1:7.9p1-10+deb10u2 armhf        secure shell (SSH) sftp server module, for SFTP access from remote machines

grep -vE « ^#|^$ » /etc/ssh/sshd_config :

#	$OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) 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 override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile	.ssh/authorized_keys .ssh/authorized_keys2

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

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

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# 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

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

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

# Example of overriding settings on a per-user basis
#Match User anoncvs
#	X11Forwarding no
#	AllowTcpForwarding no
#	PermitTTY no
#	ForceCommand cvs server

Bonjour,

bonne nouvelle, tout semble bon, donc mauvaise nouvelle aucune piste supplémentaire du coté des versions Raspbian et/ou Openssh.

Passons à l’analyse plus fine d’une communication client/serveur ssh en mode debug.

Sur le pi, dans un terminal lancer un serveur sshd
sudo /usr/sbin/sshd -D -d -p 2222

Sur le pi, dans un autre terminal lancer un client ssh
ssh -p 2222 -vvv pi@localhost

Attendre 20 min (la coupure) …
et envoyer le résultat.

A+

Bonjour,

A la coupure sur le terminal client (sur le pi) le résultat est le même que plus haut :

debug3: send packet: type 1
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i0/0 o0/0 e[write]/0 fd 5/7/8 sock -1 cc -1)

debug3: fd 1 is not O_NONBLOCK
Connection to 192.168.1.36 closed by remote host.
Connection to 192.168.1.36 closed.
Transferred: sent 3324, received 3020 bytes, in 476.0 seconds
Bytes per second: sent 7.0, received 6.3
debug1: Exit status -1

Pour le terminal serveur il y a juste une ligne : Processus arrêté.

Bonne journée :slight_smile:

Bonjour,

Ce n’est pas possible en théorie, il devrait y avoir au minimum toutela partie debug de l’établissement de la connexion ssh; soit chez moi environ 100 lignes.

Consulter les logs dans /var/log et regarder ce qu’il y a autour de l’heure ou le processus est tué.

A+

Oui, excusez moi je pensais que vous vouliez uniquement les logs après la coupure.

Comment je peux faire pour mettre les logs dans un fichier pour vous les envoyer ?

Je suis dans un terminal sans interface graphique.

Merci

Sinon une photo vous dérange pas ?

Non une photo ça va être inexploitable.

Je veux juste les retours du contenu des 2 terminaux ssh client et sshd serveur des 2 commandes demandées.

Passer par la même technique que pour les autres messages.

A+

Pour les autres messages j’utilisais >> fichier.txt que je pouvais après m’envoyer. Mais là ça ne marche pas. Comment fair pour mettre le retour dans un fichier ?

Merci

Non c’est bon j’ai trouvé je vous envoie les résultats

Re bonjour,
Voici le retour du serveur :

debug1: sshd version OpenSSH_7.9, OpenSSL 1.1.1d  10 Sep 2019
debug1: private host key #0: ssh-rsa SHA256:sWRsXYAt+hKQodCDzfA96VfSscKLnL9JornbsVh6le4
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:rVvmaWHylfrP7Htxfx3p7eH97LVvKugqEb0Fte/gIkk
debug1: private host key #2: ssh-ed25519 SHA256:OjqDXGn1AyTM7pyoTPqMGMAATT54CGv9OVf+rX0HswE
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-D'
debug1: rexec_argv[2]='-d'
debug1: rexec_argv[3]='-p'
debug1: rexec_argv[4]='2222'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 2222 on 0.0.0.0.
Server listening on 0.0.0.0 port 2222.
debug1: Bind to port 2222 on ::.
Server listening on :: port 2222.
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
debug1: inetd sockets after dupping: 3, 3
Connection from 127.0.0.1 port 59600 on 127.0.0.1 port 2222
debug1: Client protocol version 2.0; client software version OpenSSH_7.9p1 Raspbian-10+deb10u2
debug1: match: OpenSSH_7.9p1 Raspbian-10+deb10u2 pat OpenSSH* compat 0x04000000
debug1: Local version string SSH-2.0-OpenSSH_7.9p1 Raspbian-10+deb10u2
debug1: permanently_set_uid: 107/65534 [preauth]
debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: algorithm: curve25519-sha256 [preauth]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug1: rekey after 134217728 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: rekey after 134217728 blocks [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user pi service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: PAM: initializing for "pi"
debug1: PAM: setting PAM_RHOST to "127.0.0.1"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user pi service ssh-connection method password [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: PAM: password authentication accepted for pi
debug1: do_pam_account: called
Accepted password for pi from 127.0.0.1 port 59600 ssh2
debug1: monitor_child_preauth: pi has been authenticated by privileged process
debug1: monitor_read_log: child log fd closed
debug1: PAM: establishing credentials
User child is on pid 7521
debug1: SELinux support disabled
debug1: PAM: establishing credentials
debug1: permanently_set_uid: 1000/1000
debug1: rekey after 134217728 blocks
debug1: rekey after 134217728 blocks
debug1: ssh_packet_set_postauth: called
debug1: active: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch
debug1: server_input_channel_open: ctype session rchan 0 win 1048576 max 16384
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_global_request: rtype no-more-sessions@openssh.com want_reply 0
debug1: server_input_channel_req: channel 0 request pty-req reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req pty-req
debug1: Allocating pty.
debug1: session_new: session 0
debug1: SELinux support disabled
debug1: session_pty_req: session 0 alloc /dev/pts/2
debug1: server_input_channel_req: channel 0 request env reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req env
debug1: server_input_channel_req: channel 0 request shell reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req shell
Starting session: shell on pts/2 for pi from 127.0.0.1 port 59600 id 0
debug1: Setting controlling tty using TIOCSCTTY.

et du client :

OpenSSH_7.9p1 Raspbian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolve_canonicalize: hostname 127.0.0.1 is address
debug2: ssh_connect_direct
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9p1 Raspbian-10+deb10u2
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9p1 Raspbian-10+deb10u2
debug1: match: OpenSSH_7.9p1 Raspbian-10+deb10u2 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 127.0.0.1:2222 as 'pi'
debug3: put_host_port: [127.0.0.1]:2222
debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts"
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:rVvmaWHylfrP7Htxfx3p7eH97LVvKugqEb0Fte/gIkk
debug3: put_host_port: [127.0.0.1]:2222
debug3: put_host_port: [127.0.0.1]:2222
debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts"
debug1: checking without port identifier
debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts"
Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /root/.ssh/id_rsa 
debug1: Will attempt key: /root/.ssh/id_dsa 
debug1: Will attempt key: /root/.ssh/id_ecdsa 
debug1: Will attempt key: /root/.ssh/id_ed25519 
debug1: Will attempt key: /root/.ssh/id_xmss 
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug3: no such identity: /root/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_dsa
debug3: no such identity: /root/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ecdsa
debug3: no such identity: /root/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ed25519
debug3: no such identity: /root/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /root/.ssh/id_xmss
debug3: no such identity: /root/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 52
debug1: Authentication succeeded (password).
Authenticated to 127.0.0.1 ([127.0.0.1]:2222).
debug2: fd 5 setting O_NONBLOCK
debug3: fd 6 is O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug3: send packet: type 98
debug1: Sending environment.
debug3: Ignored env SHELL
debug3: Ignored env SUDO_GID
debug3: Ignored env TMUX
debug3: Ignored env SUDO_COMMAND
debug3: Ignored env SUDO_USER
debug3: Ignored env NO_AT_BRIDGE
debug3: Ignored env PWD
debug3: Ignored env LOGNAME
debug3: Ignored env HOME
debug1: Sending env LANG = fr_FR.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env TERM
debug3: Ignored env USER
debug3: Ignored env TMUX_PANE
debug3: Ignored env SHLVL
debug3: Ignored env PATH
debug3: Ignored env SUDO_UID
debug3: Ignored env MAIL
debug3: Ignored env OLDPWD
debug3: Ignored env TEXTDOMAIN
debug3: Ignored env _
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Linux home-cloud.fr 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have new mail.
Last login: Sat May  2 10:43:32 2020 from 127.0.0.1
Environment:
  LANG=en_GB.UTF-8
  USER=pi
  LOGNAME=pi
  HOME=/home/pi
  PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
  MAIL=/var/mail/pi
  SHELL=/bin/bash
  TERM=screen
  SSH_CLIENT=127.0.0.1 59600 2222
  SSH_CONNECTION=127.0.0.1 59600 127.0.0.1 2222
  SSH_TTY=/dev/pts/2
pi@home-cloud:~$ ls
log1.log  log.log
pi@home-cloud:~$ 
pi@home-cloud:~$ debug3: send packet: type 1
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i0/0 o0/0 e[write]/0 fd 4/5/6 sock -1 cc -1)

debug3: fd 1 is not O_NONBLOCK
debug1: fd 2 clearing O_NONBLOCK
Connection to 127.0.0.1 closed by remote host.
Connection to 127.0.0.1 closed.
Transferred: sent 2256, received 3484 bytes, in 1844.5 seconds
Bytes per second: sent 1.2, received 1.9
debug1: Exit status 

Je sais pas pourquoi mais cette fois dans le terminal serveur il n’y a pas « Processus arrêté. »

Bonjour,

Merci pour ces logs, malheureusement, je ne vois aucune anomalie dans les logs ni coté serveur, ni coté client. On n’a plus d’ailleurs les erreurs sshd du 15 avril 10:30.

Dans le test ci-dessus combien de temps dure la connexion avant d’être killée ?

Existe-il des fichiers sur le pi ?

/etc/hosts.allow 
/etc/hosts.deny

Existe-t-il des fichiers ?

/root/.ssh/config 
/home/pi/.ssh/config

Que contiennent-il ?