Quand la connexion deviens impossible

Bonjour,

Me revoilà pour vous demandez de m’aider, j’ai fait quelques mises à jour sur mon serveur et depuis impossible de me connecter à distance (ssh/sftp) avec un utilisateur autre que root.

Après une enquête de quelques jours de recherche, je tombe sur les logs de l’authentification avec ces messages :

1043 Nov 19 10:29:49 Zone75Test sshd[15087]: Server listening on 0.0.0.0 port 2222.
1044 Nov 19 10:35:33 Zone75Test sshd[15107]: Accepted password for walle from 192.168.1.52 port 51268 ssh2
1045 Nov 19 10:35:33 Zone75Test sshd[15107]: pam_loginuid(sshd:session): set_loginuid failed
1046 Nov 19 10:35:33 Zone75Test sshd[15107]: pam_unix(sshd:session): session opened for user walle by (uid=0)
1047 Nov 19 10:35:33 Zone75Test sshd[15107]: pam_motd(sshd:session): unknown option: noupdate
1048 Nov 19 10:35:33 Zone75Test sshd[15107]: error: PAM: pam_open_session(): Cannot make/remove an entry for the specified session.

je suis sur un Linux 2.6.32-5-vserver-686.

Salut,

C’est à dire …

local <ssh> distant ? distant <ssh> local ?

Que dit ssh en mode verbeux ?

$ ssh -vvv walle@192.168.1.52

[quote=“hanyas”]1047 Nov 19 10:35:33 Zone75Test sshd[15107]: pam_motd(sshd:session): unknown option: noupdate
1048 Nov 19 10:35:33 Zone75Test sshd[15107]: error: PAM: pam_open_session(): Cannot make/remove an entry for the specified session.[/quote]

Tu as dû jouer avec les modules PAM en [mono]/etc/pam.d/[/mono] non ?

[mono]v libpam-motd[/mono] Ce module à expiré sous Wheezy (stable) , ce qui ne semble pas être ton cas, vu le noyau, je dirais Lenny, non ?

[11:10:30][root@facteur] ~ # acp libpam-motd libpam-motd: Installé : (aucun) Candidat : (aucun) Table de version : [11:10:34][root@facteur] ~ #

[mono]Lenny -> Squeeze -> Wheezy[/mono] :think:

Où une install ? Quelle était la nature de ces mises à jour ?

la fin du dialogue après qu’il demande le mot de passe de walle (te faut-il aussi le début ?).

walle@192.168.1.55's password:
debug3: packet_send2: adding 48 (len 61 padlen 19 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentication succeeded (password).
Authenticated to 192.168.1.55 ([192.168.1.55]:2222).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug3: Ignored env INIT_CWD
debug3: Ignored env SHELL
debug3: Ignored env TERM
debug3: Ignored env SSH_CLIENT
debug3: Ignored env SSH_TTY
debug3: Ignored env USER
debug3: Ignored env LS_COLORS
debug3: Ignored env PATH
debug3: Ignored env MAIL
debug3: Ignored env PWD
debug1: Sending env LANG = fr_FR.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env HOME
debug3: Ignored env SHLVL
debug3: Ignored env LS_OPTIONS
debug3: Ignored env LOGNAME
debug3: Ignored env SSH_CONNECTION
debug3: Ignored env _
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
You have new mail.
Last login: Tue Nov 19 10:35:33 2013 from 192.168.1.52
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
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
debug2: channel 0: rcvd eow
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)

Connection to 192.168.1.55 closed.
Transferred: sent 2720, received 2584 bytes, in 0.0 seconds
Bytes per second: sent 361801.2, received 343711.1
debug1: Exit status 254

[quote=“BelZéButh”]
[mono]v libpam-motd[/mono] Ce module à expiré sous Wheezy (stable) , ce qui ne semble pas être ton cas, vu le noyau, je dirais Lenny, non ?[/quote]

Je crois que c’est bien Lenny.

[quote=“BelZéButh”]
Où une install ? Quelle était la nature de ces mises à jour ?[/quote]

Mise a jour de apache2/mysql/phpmyadmin/xdebug.

Edit 1 : dans le dossier .ssh de walle, il y a que le fichier [mono]known_hosts[/mono]

Sur quel serveur à eût lieu la mise à jour, le distant la_bas ?

Neutralises le fichier en [mono]/etc/pam.d/motd[/mono] la_bas (vérifies la syntaxe : motd) avec un [mono]# chmod 400[/mono]

Quel est son contenu d’ailleurs ?

Ouvres une console root sur le serveur la-bas suis le log [mono]# tail -f /var/log/auth.log[/mono] en live et relances une nouvelle connexion depuis le “Client(192.168.1.52)” vers le “Serveur(192.168.1.55)”

Aucune modification portée en [mono]/etc/ssh/sshd_config[/mono] récemment en local/distant ?

[quote]Edit 1 : dans le dossier .ssh de walle, il y a que le fichier known_hosts
[/quote]

:017

[mono]/home/walle/la_bas[/mono] ?

Où [mono]/home/walle/local[/mono] ?

Oui sur le serveur la_bas le 192.168.1.55.

[quote=“BelZéButh”]Neutralises le fichier en [mono]/etc/pam.d/motd[/mono] la_bas

Quel est son contenu d’ailleurs ?
[/quote]

Il n’existe pas … je n’ai que :

drwxr-xr-x  2 root root 4096 Nov 18 16:55 .
drwxr-xr-x 79 root root 4096 Nov 18 14:44 ..
-rw-r--r--  1 root root  384 Feb 15  2011 chfn
-rw-r--r--  1 root root   92 Feb 15  2011 chpasswd
-rw-r--r--  1 root root  581 Feb 15  2011 chsh
-rw-r--r--  1 root root 1208 Nov 15 14:56 common-account
-rw-r--r--  1 root root 1221 Nov 15 14:56 common-auth
-rw-r--r--  1 root root 1440 Nov 15 14:56 common-password
-rw-r--r--  1 root root 1156 Nov 15 14:56 common-session
-rw-r--r--  1 root root 1154 Nov 15 14:56 common-session-noninteractive
-rw-r--r--  1 root root  527 Jul  3  2012 cron
-rw-r--r--  1 root root 4779 May 25  2012 login
-rw-r--r--  1 root root   92 Feb 15  2011 newusers
-rw-r--r--  1 root root  520 Oct 19  2010 other
-rw-r--r--  1 root root   92 Feb 15  2011 passwd
-rw-r--r--  1 root root  454 Sep 21  2010 smtp
-rw-r--r--  1 root root 2054 May 22 03:05 sshd
-rw-r--r--  1 root root 2305 Feb 15  2011 su

J’ai vérifié et il me semble que non.

[quote=“BelZéButh”]

[mono]/home/walle/la_bas[/mono] ?

Où [mono]/home/walle/local[/mono] ?[/quote]

Sur le serveur la_bas (qui s’appel Zone75Test (192.168.1.55)) dans le dossier .ssh de l’utilisateur de walle.

Bizarre …

En résumé, tu peux établir une connexion ssh en tant que root (par mdp).

Depuis le Client (192.168.1.52) vers le serveur la_bas (192.168.1.55)

Mais ton user [mono]walle@192.168.1.55[/mono] ne peut plus. :think:

Les services ssh ont-ils été relancer de part et d’autre ? [mono]# service ssh restart[/mono]

Après cette mise à jour est-ce que tous les services étaient au vert ?

[mono]# checkrestart[/mono] -> le paquet debian-goodies doit être installé.

Vides également le contenu du fichier [mono]# echo > /home/walle/.ssh/known_hosts[/mono] la_bas et relances le service ssh.

Établis une nouvelle connexion et donnes le retour de [mono]# tail -f /var/log/auth.log[/mono] (la_bas)

il n’y en a qu’un, mais oui

root@Zone75Test:/etc/pam.d# service ssh restart
[ ok ] Restarting OpenBSD Secure Shell server: sshd.
root@Zone75Test:/etc/pam.d#

[mono]checkrestart[/mono] me renvoi :

 Found unreadable pid 1. Assuming we're under vserver and continuing.
Found 6 processes using old versions of upgraded files
(1 distinct program)
(1 distinct packages)

Of these, 1 seem to contain init scripts which can be used to restart them:
The following packages seem to have init scripts that could be used
to restart them:
apache2-bin:
        16288   /usr/sbin/apache2
        16289   /usr/sbin/apache2
        16283   /usr/sbin/apache2
        16287   /usr/sbin/apache2
        16291   /usr/sbin/apache2
        16290   /usr/sbin/apache2

These are the init scripts:
service apache2 restart

J’ai relancer apache2 mais sa n’a pas régler mon probléme.

Nov 19 14:10:16 Zone75Test sshd[16463]: Accepted password for walle from 192.168.1.52 port 56344 ssh2
Nov 19 14:10:16 Zone75Test sshd[16463]: pam_loginuid(sshd:session): set_loginuid failed
Nov 19 14:10:16 Zone75Test sshd[16463]: pam_unix(sshd:session): session opened for user walle by (uid=0)
Nov 19 14:10:16 Zone75Test sshd[16463]: pam_motd(sshd:session): unknown option: noupdate
Nov 19 14:10:16 Zone75Test sshd[16463]: error: PAM: pam_open_session(): Cannot make/remove an entry for the specified session

PS: merci pour ton aide BelZéButh

[quote=“hanyas”]Nov 19 14:10:16 Zone75Test sshd[16463]: pam_motd(sshd:session): unknown option: noupdate
Nov 19 14:10:16 Zone75Test sshd[16463]: error: PAM: pam_open_session(): Cannot make/remove an entry for the specified session

PS: merci pour ton aide BelZéButh[/quote]

:slightly_smiling:

J’ai le sentiment que c’est en [mono]/etc/pam.d/[/mono] que cela bloque.

Quels sont ces retours.

Accèdes tu physiquement à ce serveur la_bas (192.168.1.55) ?

* edit *

Copies et colles l’historique de la mise à jour fait avec aptitude (apt-get ?) en [mono]# nano -c /var/log/aptitude[/mono] en date de cette dernière (la section ci rapportant)

[quote=“BelZéButh”]

-rw-r--r-- 1 root root 4779 May 25  2012 login
-rw-r--r-- 1 root root  581 Feb 15  2011 chsh
-rw-r--r-- 1 root root 1154 Nov 15 14:56 common-session-noninteractive
-rw-r--r-- 1 root root  520 Oct 19  2010 other
-rw-r--r-- 1 root root 1156 Nov 15 14:56 common-session
-rw-r--r-- 1 root root  454 Sep 21  2010 smtp
-rw-r--r-- 1 root root 1440 Nov 15 14:56 common-password
-rw-r--r-- 1 root root   92 Feb 15  2011 chpasswd
-rw-r--r-- 1 root root   92 Feb 15  2011 newusers
-rw-r--r-- 1 root root  527 Jul  3  2012 cron
-rw-r--r-- 1 root root 1221 Nov 15 14:56 common-auth
-rw-r--r-- 1 root root   92 Feb 15  2011 passwd
-rw-r--r-- 1 root root 2054 May 22 03:05 sshd
-rw-r--r-- 1 root root 1208 Nov 15 14:56 common-account
-rw-r--r-- 1 root root 2305 Feb 15  2011 su
-rw-r--r-- 1 root root  384 Feb 15  2011 chfn

[quote=“BelZéButh”]

ii  libpam-modules                            1.1.1-6.1+squeeze1           i386         Pluggable Authentication Modules for PAM
ii  libpam-runtime                            1.1.3-9                      all          Runtime support for the PAM library
ii  libpam0g:i386                             1.1.3-9                      i386         Pluggable Authentication Modules library

Oui, je peut me connecter physiquement dessus. Juste pour préciser, ce serveur est un vserver (mais aucune mise a jour n’a été faite sur le serveur de virtualisation).

ps : j’ai édité mon post précédent …


Je ne maîtrise n’y ne connais la bête. :blush:


Il-y-a des incohérences, que je ne comprends pas.

[quote][14:56:04] ~ # acp libpam-modules
libpam-modules:
Installé : 1.1.3-7.1
Candidat : 1.1.3-7.1
Table de version :
1.1.3-10 0
95 ftp.fr.debian.org/debian/ unstable/main i386 Packages
1.1.3-9 0
97 ftp.fr.debian.org/debian/ testing/main i386 Packages
*** 1.1.3-7.1 0
990 ftp.fr.debian.org/debian/ stable/main i386 Packages
100 /var/lib/dpkg/status
1.1.1-6.1+squeeze1 0
500 ftp.fr.debian.org/debian/ oldstable/main i386 Packages
500 security.debian.org/ oldstable/updates/main i386 Packages
[14:56:09] ~ #
[14:56:22] ~ #

[14:56:24] ~ # acp libpam-runtime
libpam-runtime:
Installé : 1.1.3-7.1
Candidat : 1.1.3-7.1
Table de version :
1.1.3-10 0
95 ftp.fr.debian.org/debian/ unstable/main i386 Packages
1.1.3-9 0
97 ftp.fr.debian.org/debian/ testing/main i386 Packages
*** 1.1.3-7.1 0
990 ftp.fr.debian.org/debian/ stable/main i386 Packages
100 /var/lib/dpkg/status
1.1.1-6.1+squeeze1 0
500 ftp.fr.debian.org/debian/ oldstable/main i386 Packages
500 security.debian.org/ oldstable/updates/main i386 Packages
[14:56:27] ~ #
[14:56:38] ~ #

[14:56:39] ~ # acp libpam0g:i386
libpam0g:
Installé : 1.1.3-7.1
Candidat : 1.1.3-7.1
Table de version :
1.1.3-10 0
95 ftp.fr.debian.org/debian/ unstable/main i386 Packages
1.1.3-9 0
97 ftp.fr.debian.org/debian/ testing/main i386 Packages
*** 1.1.3-7.1 0
990 ftp.fr.debian.org/debian/ stable/main i386 Packages
100 /var/lib/dpkg/status
1.1.1-6.1+squeeze1 0
500 ftp.fr.debian.org/debian/ oldstable/main i386 Packages
500 security.debian.org/ oldstable/updates/main i386 Packages
[14:56:42] ~ # [/quote]


:question:

[quote=“BelZéButh”]
Copies et colles l’historique de la mise à jour fait avec aptitude (apt-get ?) en [mono]# nano -c /var/log/aptitude[/mono] en date de cette dernière (la section ci rapportant)[/quote]

[code]Aptitude 1.6.3: log report
2 Fri, Nov 15 2013 15:12:47 +0100
3
4 IMPORTANT: this log only lists intended actions; actions which fail due to
5 dpkg problems may not be completed.
6
7 Will install 0 packages, and remove 11 packages.
8 16.4 MB of disk space will be freed
9 ===============================================================================
10 [REMOVE, NOT USED] apache2-mpm-prefork
11 [REMOVE, NOT USED] apache2-utils
12 [REMOVE, NOT USED] debhelper
13 [REMOVE, NOT USED] html2text
14 [REMOVE, NOT USED] libdb4.7
15 [REMOVE, NOT USED] libjpeg62
16 [REMOVE, NOT USED] libmysqlclient16
17 [REMOVE, NOT USED] libserf-0-0
18 [REMOVE, NOT USED] libt1-5
19 [REMOVE, NOT USED] openssh-blacklist
20 [REMOVE, NOT USED] openssh-blacklist-extra
21 [HOLD, DEPENDENCIES] cpp
22 [HOLD, DEPENDENCIES] cpp-4.7
23 [HOLD, DEPENDENCIES] g++
24 [HOLD, DEPENDENCIES] g+±4.7
25 [HOLD, DEPENDENCIES] gcc
26 [HOLD, DEPENDENCIES] gcc-4.7
27 [HOLD, DEPENDENCIES] gcc-4.7-base
28 [HOLD, DEPENDENCIES] gettext-base
29 [HOLD, DEPENDENCIES] git
30 [HOLD, DEPENDENCIES] libcurl3
31 [HOLD, DEPENDENCIES] libcurl3-gnutls
32 [HOLD, DEPENDENCIES] libdrm-intel1
33 [HOLD, DEPENDENCIES] libgl1-mesa-dri
34 [HOLD, DEPENDENCIES] libgl1-mesa-glx
35 [HOLD, DEPENDENCIES] libglib2.0-0
36 [HOLD, DEPENDENCIES] libgpgme11
37 [HOLD, DEPENDENCIES] liblockfile1
38 [HOLD, DEPENDENCIES] libstdc++6-4.7-dev
39 [HOLD, DEPENDENCIES] m4
40 [HOLD, DEPENDENCIES] python-minimal
41 [HOLD, DEPENDENCIES] tcl
42 [HOLD, DEPENDENCIES] tk
43 [HOLD, DEPENDENCIES] ttf-dejavu-core
44 [HOLD, DEPENDENCIES] x11-utils
45 [HOLD] apt
46 [HOLD] apt-utils
47 [HOLD] aptitude
48 [HOLD] curl
49 [HOLD] gitk
50 [HOLD] iptables
51 [HOLD] iputils-ping
52 [HOLD] libpam-modules
53 [HOLD] libudev0
54 [HOLD] man-db
55 [HOLD] module-init-tools
56 [HOLD] mount
57 [HOLD] mutt
58 [HOLD] passwd
59 [HOLD] python
60 [HOLD] udev
61 [HOLD] wget
62 ===============================================================================
Log complete.
65 Aptitude 0.6.3: log report
66 Mon, Nov 18 2013 14:44:25 +0100
67
68 IMPORTANT: this log only lists intended actions; actions which fail due to
69 dpkg problems may not be completed.
70
71 Will install 7 packages, and remove 0 packages.
72 6886 kB of disk space will be used
73 ===============================================================================
74 [HOLD, DEPENDENCIES] cpp
75 [HOLD, DEPENDENCIES] cpp-4.7
76 [HOLD, DEPENDENCIES] g++
77 [HOLD, DEPENDENCIES] g+±4.7
78 [HOLD, DEPENDENCIES] gcc
79 [HOLD, DEPENDENCIES] gcc-4.7
80 [HOLD, DEPENDENCIES] gcc-4.7-base
81 [HOLD, DEPENDENCIES] gettext-base
82 [HOLD, DEPENDENCIES] git
83 [HOLD, DEPENDENCIES] libcurl3
84 [HOLD, DEPENDENCIES] libcurl3-gnutls
85 [HOLD, DEPENDENCIES] libdrm-intel1
86 [HOLD, DEPENDENCIES] libgl1-mesa-dri
87 [HOLD, DEPENDENCIES] libgl1-mesa-glx
88 [HOLD, DEPENDENCIES] libglib2.0-0
89 [HOLD, DEPENDENCIES] libgpgme11
90 [HOLD, DEPENDENCIES] liblockfile1
91 [HOLD, DEPENDENCIES] libstdc++6-4.7-dev
92 [HOLD, DEPENDENCIES] m4
93 [HOLD, DEPENDENCIES] python-minimal
94 [HOLD, DEPENDENCIES] tcl
95 [HOLD, DEPENDENCIES] tk
96 [HOLD, DEPENDENCIES] ttf-dejavu-core
97 [HOLD, DEPENDENCIES] x11-utils
98 [INSTALL, DEPENDENCIES] debootstrap
99 [INSTALL, DEPENDENCIES] libnspr4
100 [INSTALL, DEPENDENCIES] libnss3
101 [INSTALL, DEPENDENCIES] libnss3-1d
102 [HOLD] apt
103 [HOLD] apt-utils

104 [HOLD] aptitude
105 [HOLD] curl
106 [HOLD] gitk
107 [HOLD] iptables
108 [HOLD] iputils-ping
109 [HOLD] libpam-modules
110 [HOLD] libudev0
111 [HOLD] man-db
112 [HOLD] module-init-tools
113 [HOLD] mount
114 [HOLD] mutt
115 [HOLD] passwd
116 [HOLD] python
117 [HOLD] udev
118 [HOLD] wget
119 [INSTALL] linux-image-vserver-686
120 [INSTALL] ssh
121 [INSTALL] util-vserver
122 ===============================================================================
123
124 Log complete.
[/code]

Linux Zone75Test 2.6.32-5-vserver-686 #1 SMP Mon Jun 13 07:28:40 UTC 2011 i686 GNU/Linux

libc6: Installed: 2.17-93 Candidate: 2.17-93 Version table: *** 2.17-93 0 500 http://ftp.fr.debian.org/debian/ testing/main i386 Packages 100 /var/lib/dpkg/status 2.11.3-4 0 500 http://ftp.fr.debian.org/debian/ squeeze/main i386 Packages

Ce serveur étais a la base géré par un collègue de travail (malheureusement partie).J’aurais du mal a t’expliquer ces incohérences :119 (je ne suis qu’un néophyte en UNIX)