PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Suse9.3 | 'PermitRootLogin no' funktioniert nicht



phor
25.07.06, 07:21
Hallo,

habe mit meinem Stratoserver das Problem, dass ich einfach den root-login nicht deaktiviert kriege. Bei meinem alten 1blu-Server ging das ohne Weiteres :ugly:

Ich habe in der '/etc/ssh/sshd_config' PermitRootLogin auf no gesetzt (alles mögliche ausprobiert; mit Auskommentierung, ohne, etc...) UsePAM deaktivieren bringt auch keine Änderung, ebenso DenyUsers, AllowUsers...
Natürlich habe ich auch immer via '/etc/init.d/sshd restart' den ssh-Dienst neu gestartet, um die Änderungen aktiv werden zu lassen.
(Die Änderung des SSH-Ports hat immerhin geklappt ;-))


Außerdem habe ich das Problem, dass neuerdings beim ssh restart alle aktiven SSH Konsolen geschlossen werden...?!

Hier meine sshd_config:


# $OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker 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 change a
# default value.

#Port 22
Port xxxxx
#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 1h
#ServerKeyBits 768

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

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
PermitRootLogin no

#StrictModes yes
#MaxAuthTries 6

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

# 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
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

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

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

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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'yes' to enable support for the deprecated 'gssapi' authentication
# mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included
# in this release. The use of 'gssapi' is deprecated due to the presence of
# potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to.
#GSSAPIEnableMITMAttack 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 mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no

UsePAM no

#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10



# no default banner path
#Banner /some/path

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

# This enables accepting locale enviroment variables LC_* LANG, see sshd_config(5).
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL




Wäre wirklich sehr dankbar, wenn mir hier jemand weiter helfen könnte.

craano
25.07.06, 08:18
Wie wäre es, wenn Du mit:

passwd -l root
einfach das Passwort disablest? Dann kann man sich nicht mejr als root anmelden.

Wenn Du mal wieder eins brauchst, setzt Du einfach ein neues. Diesen Weg geht auch Ubuntu, finde ich persönlich nicht schlecht.

Vergiß aber nicht Dir entsprechende sudo Rechte zu vergeben, damit Du später wieder ein Passwort für root setzen kannst.

Grüße.
craano.

phor
25.07.06, 08:27
Wie wäre es, wenn Du mit:

passwd -l root
einfach das Passwort disablest? Dann kann man sich nicht mejr als root anmelden.

Wenn Du mal wieder eins brauchst, setzt Du einfach ein neues. Diesen Weg geht auch Ubuntu, finde ich persönlich nicht schlecht.

Du meinst, ich fahre ins Rechenzentrum und Strato lässt mich dann kurz obiges erledigen?



Vergiß aber nicht Dir entsprechende sudo Rechte zu vergeben, damit Du später wieder ein Passwort für root setzen kannst.


Gerade deshalb will ich ja den root-Login deaktivieren, um eine doppelte Sicherheit zu erlangen und via userlogin und su kann ich rootstatus bekommen.

Im Moment müsste der potentielle Eindringer nur das rootpw wissen.

Wenn ich root deaktivieren könnte, wären username+userpw+rootpw nötig.

phor
27.07.06, 11:27
Wirklich niemand da, der sich auskennt?

bla!zilla
27.07.06, 11:31
Aktuelle Version vom SSHd? SSHd auch neu gestartet? Ich konnte den Fehler nicht reproduzieren. Mal bugzilla.novell.com nach diesem Bug durchsucht? Evtl. Bug Ticket eröffnen?

phor
27.07.06, 11:58
Hab jetzt eben mal die sshd_config gleicher Version von nem anderen Suse Server genommen, auf dem root login deaktiviert ist. Ging auch nicht... in der config is also schon mal nix verpfuscht... muss der Fehler wo anders liegen.

sshd wird regelmäßig via you (;-)) aktualisiert, eben geschaut - is aktuell.

Auf bugzilla find ich nix zu Suse 9.3 und SSHd

Was mich nun allerdings etwas stutzig macht ist die StartTime, die mit Abfrage "ps -ef" angezeigt wird:

http://people.freenet.de/phori/ssh.jpg

Starte SSHd immer via


/etc/init.d/sshd restart neu...

bla!zilla
27.07.06, 12:08
Mal gegoogelt? Der Fehler ist mir gänzlich unbekannt. Alternativ Ticket beu bugzilla.novell.com eröffnen (sofern es für die 9.3 noch möglich ist, sollte es aber).

RichieX
27.07.06, 13:00
Was passiert denn, wenn du ihm die config Datei mitgibst: /usr/sbin/sshd -f /pfad/zur/sshd_config

phor
27.07.06, 13:12
Zu Suse 9.3 gibts wohl keine Möglichkeit mehr unter bugzilla zu berichten... nur noch Suse 10.x und openSuse.org...




Was passiert denn, wenn du ihm die config Datei mitgibst: /usr/sbin/sshd -f /pfad/zur/sshd_config

das in die /etc/init.d/sshd schreiben?!


Was ich mich auch frage, warum die Konsolenfenster bei /etc/init.d/sshd restart geschlossen werden bzw. die Verbindung abbricht?!

Normal kommt da doch
SHutting SSH down... done
startingblabla... done

?!?!

Sollte ich evtl. den Server mal rebooten?

Cerox
27.07.06, 13:17
das in die /etc/init.d/sshd schreiben?!

Nein, so sollst du den sshd starten; dafür musst du ihn wohl erst stoppen also verbinde das in einem Script und keine Fehler machen - ist ja ein root ^^ - wieso hast du bloß einen root? Ach, nein, lassen wir das Thema.


Sollte ich evtl. den Server mal rebooten?

Wenn du einen neuen Kernel aktivieren möchtest, wirst du wohl rebooten müssen. Ansonsten nein.

phor
27.07.06, 13:53
das sollte reichen?!

#!/bin/bash
/etc/init.d/sshd stop
/usr/sbin/sshd -f /etc/ssh/sshd_config



zu obigem Screenshot noch:
Besagt Jun05 nicht, dass der SSH seit 05. Juni läuft? Das würde ja heißen, dass '/etc/init.d/sshd restart' herzlich wenig bringt?

RichieX
27.07.06, 14:57
Welche sshd-Version läuft denn?

phor
27.07.06, 15:12
OpenSSH 3.9p1

RichieX
27.07.06, 15:34
Edit: großen Mist geschrieben.

phor
27.07.06, 15:45
OpenSSH_3.9p1, OpenSSL 0.9.7e 25 Oct 2004

obiger command liefert:

-rwxr-xr-x 1 root root 295188 Feb 7 15:46 /usr/sbin/sshd