Was ist da los?

cb01

Registered User
Hi,

ich hab gerade mal so in die log messages geschaut, und dabei sind mir div. Zeilen mit folgendem Inhalt ins Auge gesprungen:

Nov 27 20:03:45 *HOSTNAME* sshd[11497]: reverse mapping checking getaddrinfo for 236.194.212.121.coprosys.cz failed - POSSIBLE BREAKIN ATTEMPT!

Von diesen Einträgen hab ich bestimmt um die 100 oder mehr in den Logs, was bedeutet dies?...muss ich mir sorgen machen?
Als System hab ich einen VServer mit Suse 9.3...

Gruß

Chris
 
Sichere deinen sshd ein wenig ab, dann brauchst du dir (normalerweise) keine Sorgen machen.

*) Port verlegen
*) Key auth
*) denyhosts
*) usw.

Verwende einfach einmal die Forensuche, dann findest du unzählige Beiträge was und wie du deinen Server absichern kannst.
 
Hi,

erstmal danke für die Hilfe, bin jetzt gerade dabei den SSH Port zuverlegen, habe dazu die Anleitung von huschi verwendet: huschi.net - Wie ändere ich den SSH Port?
Ich habe alles entsprechend in der Config datei geändert, aber leider kann ich mich trotz div. ssh neustarts immer noch mit dem alten Port einloggen :-(...
Hier mal ein Auszug aus der Configdatei:
# $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 34452
#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 no
#StrictModes yes
#MaxAuthTries 6
 
So auf den ersten Blick würde ich sagen, da sind ja alle Einstellungen auskommentiert. Oder hat das # hier eine andere Funktion?
 
So auf den ersten Blick würde ich sagen, da sind ja alle Einstellungen auskommentiert. Oder hat das # hier eine andere Funktion?
Nein hat es nicht. Er hat alles auskommentiert

@cb01
Bei allem was aktiv sein soll mußt du die # wegmachen =)
 
Hi,

erstmal danke für die Hilfe, habe jetzt mal die unnötigen # (ka. warum WinSCP die da hingebaut hat) entfernt, wenn ich jetzt in der Konsole ssh -vv localhost eintippe wird mir der neue Port zwar angezeigt, aber ich kann mich trotzdem noch mit dem alten Port einloggen.
Dann hab ich noch eine evtl. etwas doofe Frage, auf der Seite von huschi steht, man soll permitrootlogin auf no setzen, womit soll ich mich dann einloggen?

Gruß

Chris
 
# 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.

Das ist der Grund warum alles auskommentiert ist.

Grüße
Sinepp
 
Hallo!

Dann hab ich noch eine evtl. etwas doofe Frage, auf der Seite von huschi steht, man soll permitrootlogin auf no setzen, womit soll ich mich dann einloggen?

Man legt sich einen zweiten unauffälligen Benutzer an, loggt sich mit diesen per SSH ein und wechseln dann auf den root Account.

Code:
su -l

Gruß flyingoffice
 
Hi,

so einen neuen User hab ich angelegt, und rootloginpermit of no gesetzt, aber leider kann ich mich, wenn ich mich über Port22 auf dem Server anmelde immer noch direkt mit root reinkommen.
Hier mal die 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 34452
Protocol 2
#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 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

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

#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#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

Gruß

Chris
 
Hallo!

Probier es mal mit der folgenden Änderung

Code:
UsePAM no

Gruß flyingoffice
 
Hallo!

Dann bitte nochmal die folgende Einstellung versuchen

Code:
ChallengeResponseAuthentication no

Gruß flyingoffice
 
Hi,

leider auch keine Änderung:confused:

Hier mal die ssh_config:

# $OpenBSD: ssh_config,v 1.19 2003/08/13 08:46:31 markus Exp $

# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for various options

Host *
# ForwardAgent no
# ForwardX11 no

# If you do not trust your remote host (or its administrator), you
# should not forward X11 connections to your local X11-display for
# security reasons: Someone stealing the authentification data on the
# remote side (the "spoofed" X-server by the remote sshd) can read your
# keystrokes as you type, just like any other X11 client could do.
# Set this to "no" here for global effect or in your own ~/.ssh/config
# file if you want to have the remote X11 authentification data to
# expire after two minutes after remote login.
ForwardX11Trusted yes

# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
Port 34452
Protocol 2
# Cipher 3des
# Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
# EscapeChar ~
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no

# 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

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

und die 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 34452
Protocol 2
#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 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 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 yes
#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

Gruß

Chris
 
Hi Chris,

so langsam habe ich Zweifel, dass die SSHD_CONF in /etc/ nicht genutzt wird oder der Neustart in die Hose geht, warum auch immer. Schonmal ein reboot probiert?

Schau mal in /etc/sysconfig ob da der Start von SSHD geregelt wird, mit manueller Portangabe evtl oder andere Configfile. Du könntest auch mal die Configfile umbenennen und ein /etc/init.d/ssh restart ausprobieren. (oder sshd restart, das weiß ich gerade nicht). Wenn der dann noch geht, schau ob eine neue SSHD_CONF angelegt wurde. Wenn nicht, dann zieht er sich die File von irgendwo anders. find / -name SSHD_* z.B. könnte Dir da weiterhelfen oder eben im /etc/sysconfig mal nachschauen.

Grüße
Sinepp
 
Moin Sinepp,

so wie es aussieht nutzt er die SSHD_Config, aufjedenfall funzt der Reboot nicht, wenn ich die Datei umbenenne, dementsprechend muss der Fehler woanders liegen:confused: ...

Gruß

Chris, der so langsam an sich selbst zweifeld:(
 
Es sieht (auch verglichen mit meiner sshd_conf) alles richtig aus, die im Verzeichnis /etc/ssh/sshd_conf liegt. Schonmal einen Server reboot probiert?

Guck mal in der Datei /etc/sysconfig/ssh nach, ob dort irgendwelche Startparameter gesetzt sind.
Grüße
Sinepp
 
Moin,

meine die SSH Datei in der sysconfig sieht so aus:

## Path: Network/Remote access/SSH
## Description: SSH server settings
## Type: string
## Default: ""
## ServiceRestart: sshd
#
# Options for sshd
#
SSHD_OPTS=""

Reboot hab ich noch nicht gemacht...

Gruß

Chris
 
Moinsens,

also ich mag ja diese "versuch mal einen Reboot" Taktik garnicht, aber ich glaube ich würds trotzdem mal probieren.

Hast Du schonmal SSHD und alles drum herum mit einem kill -9 gekillt? Bzw. ein sshd stop gemacht und mit ps aux | grep ssh geguckt, ob auch wirklich die Lichter aus sind?

Grüße
Sinepp

P.s.: Hm...weiß nicht, was dann mit Deiner Session passiert. Lol...eventuell brauchst Du spätestens dann nen Reboot, damit sich der SSH-Deamon wieder startet :)
 
Back
Top