sshd zombie prozesse

FreeBSD, Gentoo, openSUSE, CentOS, Ubuntu, Debian
materia
Posts: 21
Joined: 2005-03-15 15:06
 

sshd zombie prozesse

Post by materia »

Moin,

folgendes Problem: seit einer Ewigkeit werden einige unbenutzte sshd-Prozesse nicht mehr aus dem Speicher entfernt. Sie laufen als zombies einfach weiter. Ich kann jede Woche so eine Liste an Prozessen killen...

Code: Select all

root      3059  0.0  0.2  3544  736 ?        Ss    2005   6:21 /usr/sbin/sshd
root      2511  0.0  0.3 11956  944 ?        Ss   Feb25   0:00  _ sshd: user_1 [priv]
user_1    2514  0.0  0.2 11956  664 ?        S    Feb25   0:00  |   _ sshd: user_1@notty
user_1    2515  0.0  0.0     0    0 ?        Zs   Feb25   0:00  |       _ [bash] <defunct>
root     15246  0.0  0.3 11956  944 ?        Ss   Feb26   0:00  _ sshd: user_1 [priv]
user_1   15249  0.0  0.2 11956  664 ?        S    Feb26   0:00  |   _ sshd: user_1@notty
user_1   15250  0.0  0.0     0    0 ?        Zs   Feb26   0:00  |       _ [bash] <defunct>
root     17298  0.0  0.3 11956  944 ?        Ss   Feb27   0:00  _ sshd: user_1 [priv]
user_1   17301  0.0  0.2 11956  724 ?        S    Feb27   0:00  |   _ sshd: user_1@notty
user_1   17302  0.0  0.0     0    0 ?        Zs   Feb27   0:00  |       _ [bash] <defunct>
root     13350  0.0  0.3 11956  944 ?        Ss   Feb28   0:00  _ sshd: user_1 [priv]
user_1   13353  0.0  0.2 12120  728 ?        S    Feb28   0:00  |   _ sshd: user_1@notty
user_1   13354  0.0  0.2  2552  496 ?        Ss   Feb28   0:00  |       _ -bash
root     13887  0.0  0.3 11956  944 ?        Ss   Feb28   0:00  _ sshd: user_1 [priv]
user_1   13890  0.0  0.2 12120  728 ?        S    Feb28   0:00  |   _ sshd: user_1@notty
user_1   13891  0.0  0.2  2556  496 ?        Ss   Feb28   0:00  |       _ -bash
root      9477  0.0  0.3 11956  944 ?        Ss   Feb28   0:00  _ sshd: user_2  [priv]
user_2    9480  0.0  0.2 11956  664 ?        S    Feb28   0:00  |   _ sshd: user_2 @notty
user_2    9481  0.0  0.0     0    0 ?        Zs   Feb28   0:00  |       _ [bash] <defunct>
root     22133  0.0  0.3 11956  944 ?        Ss   Mar01   0:00  _ sshd: user_1 [priv]
user_1   22136  0.0  0.2 12120  668 ?        S    Mar01   0:00  |   _ sshd: user_1@notty
user_1   22137  0.0  0.2  2556  496 ?        Ss   Mar01   0:00  |       _ -bash
root     22817  0.0  0.3 11956  944 ?        Ss   Mar01   0:00  _ sshd: user_1 [priv]
user_1   22820  0.0  0.2 12120  668 ?        S    Mar01   0:00  |   _ sshd: user_1@notty
user_1   22821  0.0  0.0     0    0 ?        Zs   Mar01   0:00  |       _ [bash] <defunct>
root     25780  0.0  0.3 11956  944 ?        Ss   Mar01   0:00  _ sshd: user_1 [priv]
user_1   25783  0.0  0.2 11956  724 ?        S    Mar01   0:00  |   _ sshd: user_1@notty
user_1   25784  0.0  0.0     0    0 ?        Zs   Mar01   0:00  |       _ [bash] <defunct>
root      2607  0.0  0.6 11956 1672 ?        Ss   Mar03   0:00  _ sshd: user_1 [priv]
user_1    2610  0.0  0.6 12116 1500 ?        S    Mar03   0:00  |   _ sshd: user_1@notty
user_1    2611  0.0  0.4  2552 1204 ?        Ss   Mar03   0:00  |       _ -bash
root      3309  0.0  0.6 11956 1672 ?        Ss   Mar03   0:00  _ sshd: user_1 [priv]
user_1    3312  0.0  0.6 12088 1508 ?        S    Mar03   0:00  |   _ sshd: user_1@notty
user_1    3313  0.0  0.4  2556 1208 ?        Ss   Mar03   0:00  |       _ -bash
root      5996  0.0  0.6 11956 1668 ?        Ss   Mar05   0:00  _ sshd: user_2  [priv]
user_2    5999  0.0  0.5 12112 1464 ?        S    Mar05   0:00  |   _ sshd: user_2 @notty
user_2    6000  0.0  0.0     0    0 ?        Zs   Mar05   0:00  |       _ [bash] <defunct>
root     12063  0.0  0.6 11956 1668 ?        Ss   Mar05   0:00  _ sshd: user_2  [priv]
user_2   12066  0.0  0.5 12120 1456 ?        S    Mar05   0:00  |   _ sshd: user_2 @notty
user_2   12067  0.0  0.0     0    0 ?        Zs   Mar05   0:00  |       _ [bash] <defunct>
root      8631  0.0  0.6 11956 1672 ?        Ss   Mar06   0:00  _ sshd: user_1 [priv]
user_1    8634  0.0  0.6 12120 1512 ?        S    Mar06   0:00  |   _ sshd: user_1@notty
user_1    8635  0.0  0.0     0    0 ?        Zs   Mar06   0:00  |       _ [bash] <defunct>
root     11770  0.0  0.6 11956 1668 ?        Ss   Mar06   0:00  _ sshd: user_1 [priv]
user_1   11773  0.0  0.5 11788 1296 ?        S    Mar06   0:00  |   _ sshd: user_1@notty
user_1   11774  0.0  0.0     0    0 ?        Zs   Mar06   0:00  |       _ [bash] <defunct>
root     31930  0.1  0.7 12084 1812 ?        Ss   08:02   0:00  _ sshd: root@pts/1
root     31934  0.0  0.5  2660 1476 pts/1    Ss   08:02   0:00      _ -bash
root     31972  0.0  0.3  2564  884 pts/1    R+   08:05   0:00          _ ps faux
sshd_config:

Code: Select all

#       $OpenBSD: sshd_config,v 1.38 2001/04/15 21:41:29 deraadt Exp $

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

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

Port 22
Protocol 2
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey /etc/ssh/ssh_host_key
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
ServerKeyBits 768
LoginGraceTime 600
KeyRegenerationInterval 3600
#PermitRootLogin without-password
PermitRootLogin yes
#
# Don't read ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
StrictModes yes
X11Forwarding no
X11DisplayOffset 10
PrintMotd no
PrintLastLog no
KeepAlive no

# Privilege seperation geht nicht unter 2.2 mit eingeschalteter Kompression,
# da dort mmap anders implementiert ist:
Compression no

# Logging
SyslogFacility AUTH
LogLevel DEBUG
#obsoletes QuietMode and FascistLogging

#RhostsAuthentication no
#
# 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
#
RSAAuthentication yes

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

# Uncomment to disable s/key passwords
#ChallengeResponseAuthentication no

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

# To change Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#AFSTokenPassing no
#KerberosTicketCleanup no

# Kerberos TGT Passing does only work with the AFS kaserver
#KerberosTgtPassing yes

#CheckMail yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net
#ReverseMappingCheck yes

#Subsystem      sftp    /usr/lib/sftp-server
UsePAM yes
Kernel: 2.6.14
sshd: OpenSSH_3.8.1p1 Debian-8.sarge.4, OpenSSL 0.9.7e 25 Oct 2004

Client: PuTTY 0.58

Kann mir jemand sagen wie ich diese zombie-Prozesse vermeide?

Vielen Dank schonmal!
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: sshd zombie prozesse

Post by Joe User »

sshd_config korrigieren und:

Code: Select all

apt-get update
apt-get upgrade
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
materia
Posts: 21
Joined: 2005-03-15 15:06
 

Re: sshd zombie prozesse

Post by materia »

Joe User wrote:sshd_config korrigieren
inwiefern?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: sshd zombie prozesse

Post by Joe User »

PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
materia
Posts: 21
Joined: 2005-03-15 15:06
 

Re: sshd zombie prozesse

Post by materia »

Uhm ich dachte mir ich erfahre nun was genau an der Config falsch ist bzw. was fehlt damit dieser Effekt nicht mehr eintritt. Aber gut, probiere ich halt mal die stupide Variante...

EDIT:

Code: Select all

/etc/ssh/sshd_config: line 10: Bad configuration option: AddressFamily
EDIT2:

Wozu soll das gut sein? Das bringt irgendwie mal garnichts sinnvolles... (ja ich kann manpages lesen)

Code: Select all

PasswordAuthentication no
Jemand da, der mir sagen kann woher die z-Prozesse kommen?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: sshd zombie prozesse

Post by Joe User »

Deine bash und/oder Dein sshd ist buggy, Updaten und sinnvoll konfigurieren hilft...
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
materia
Posts: 21
Joined: 2005-03-15 15:06
 

Re: sshd zombie prozesse

Post by materia »

Nun ich hab da nichts dran rekonfiguiert... Ist jeweils auch die neueste verfügbare Version. Dann sind wohl alle Debian-Distributed bash/sshd buggy =/
keepoer
Posts: 57
Joined: 2005-10-17 14:47
 

Re: sshd zombie prozesse

Post by keepoer »

Ich glaube kaum!
Auf meinem Server zumindest laufen keine Zombies rum! :wink:
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: sshd zombie prozesse

Post by Joe User »

materia wrote:Nun ich hab da nichts dran rekonfiguiert... Ist jeweils auch die neueste verfügbare Version. Dann sind wohl alle Debian-Distributed bash/sshd buggy =/
Debian hat ja durchaus eine recht eigenwillige Art was Konfigurationsdateien angeht, aber eine solche sshd_config traue ich selbst Debian nicht zu.

Wielange liegt Dein Letztes

Code: Select all

apt-get update && apt-get upgrade
zurück?
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
materia
Posts: 21
Joined: 2005-03-15 15:06
 

Re: sshd zombie prozesse

Post by materia »

Joe User wrote:Wielange liegt Dein Letztes

Code: Select all

apt-get update && apt-get upgrade
zurück?
Ein paar Minuten und da wurden auch keine relevanten Pakete die betroffen sein könnten von dem Problem ausgetauscht...

Ich vermute eher, dass was am Kernel nicht stimmt. Der Kernel ist ein vorkompilierter Kernel von 3-1. Ich hatte vorher Probleme mit willkürlichen Reboots der Kiste (siehe meine bisherigen Beiträge hier - EDIT: Oh scheinbar hatte ich dazu doch nicht gepostet... ;)) habe damals verschiedene selbstkompilierte und vorgefertigte Kernelversionen probiert und es gab trotzdem ständig nach zufälligen Abständen Reboots ohne Logeintrag. Letztendlich hab ich auf dem FTP-Server meines geliebten Anbieters einen Kernel gefunden, der dieses Problem nicht verursacht (also lag es wohl am Kernel oder der Kernelkonfiguration) auf jeden Fall läuft die Kiste nun 148 Tage ohne Probleme.

Nachdem das Reboot-Problem beseitigt war habe ich den Server nochmal komplett neu Aufgesetzt mit dem Debian meines geliebten Server-Anbieters (und dem als Problemfrei empfundenen Kernel) und alle Pakete auf den neuesten Stand gebracht.

Der Speicher ist in Ordnung (war er jedenfalls vor 148 Tagen als ich nen längeren Test durchlaufen liess).

*ratlos*
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: sshd zombie prozesse

Post by Joe User »

Du solltest dringend alle verfügbaren Updates einspielen, inklusive Kernel und anschliessendem Reboot.

Das Rebootproblem beseitigst Du durch setzen folgender Kerneloption:
# CONFIG_X86_REBOOTFIXUPS is not set
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
braindead
Posts: 250
Joined: 2002-10-22 09:49
Location: vorm Rechner
 

Re: sshd zombie prozesse

Post by braindead »

1. hör auf Joe und räum deine SSHD config auf
2. guck dich mal in den logs um warum die bash hängen bleibt

@joe das ssh ist das aktuelle für debian sarge.
materia
Posts: 21
Joined: 2005-03-15 15:06
 

Re: sshd zombie prozesse

Post by materia »

Wenn ich da die Gentoo Config reinkopiere läuft garnichts mehr weil a) es kein "AddressFamily" gibt und
b) "PasswordAuthentication no" mich nicht mehr einloggen lässt.
Das Rebootproblem beseitigst Du durch setzen folgender Kerneloption:
# CONFIG_X86_REBOOTFIXUPS is not set
Und da bist du dir ganz sicher? Naja vielleicht werd ich ja mal wenn ich ganz lustig bin (sehr viel Zeit hab) den Kernel neu kompilieren mit dieser Magischen Anti-1&1-Reboot-Formel "CONFIG_X86_REBOOTFIXUPS"...

Also ich verstehe das nun so, dass ich "CONFIG_X86_REBOOTFIXUPS" EINSCHALTEN soll und nicht auskommentieren soll so wie du das beschreibst? ...
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: sshd zombie prozesse

Post by Joe User »

/me: Sind schon wieder Ferien, oder ist das RootForum Bestandteil der aktuellen Pisastudie?
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
materia
Posts: 21
Joined: 2005-03-15 15:06
 

Re: sshd zombie prozesse

Post by materia »

Joe User wrote:/me: Sind schon wieder Ferien, oder ist das RootForum Bestandteil der aktuellen Pisastudie?
Keine Ahnung, aber Peudo-Wissen und dumme Sprüche helfen mir auch nicht weiter....
flo
Posts: 2223
Joined: 2002-07-28 13:02
Location: Berlin
 

Re: sshd zombie prozesse

Post by flo »

materia wrote:Keine Ahnung, aber Peudo-Wissen und dumme Sprüche helfen mir auch nicht weiter....
@materia : Ho ... ruhig, brauner ... brrr ;-)

Startest Du im profile oder in der bashrc (in irgendeiner) etwas, das hängen bleibt, nutzt Du sftp, rsync oder sonst etwas in der Art, das automatische Logins benutzt? Heißt der einloggende User wirklich user_1 oder ist der maskiert? Was macht der? Bitte poste den relevanten Teil aus der password

Und nur interessehalber - wie administrierst Du die Kiste, wenn die Bash sich nach dem ssh aufhängt oder passiert das nach/mit dem Logout?

flo.