ich habe 4 Roots und bei einem davon bekam ich heute früh mal wieder einen Schock. Ich loggte mich ein, weil die Kiste lahmte (habe SSH nur per Private-Key laufen). Es waren 2 User (inkl. mir) eingeloggt. Ich als root und einer als admin (Debian-User) und es lief "ssh-scan". Zuerst war ich baff wie der das geschafft hat. Ich schaute - wie üblich - ins /tmp, wo sich ein Ordner .a befand, der admin gehört(e). Den löschte ich sofort, vergab ein neues PW für admin und rebootete die Kiste. Da war er weg.
Ein Blick in die Logs zeigte dann das:
Code: Select all
Jun 6 08:07:11 athen21 sshd[6820]: Failed password for illegal user info from 66.218.54.46 port 46268 s$
Jun 6 08:07:12 athen21 sshd[6822]: Failed password for root from 66.218.54.46 port 56408 ssh2
Jun 6 08:07:12 athen21 sshd[6824]: Illegal user test from 66.218.54.46
Jun 6 08:07:12 athen21 sshd[6824]: error: Could not get shadow information for NOUSER
Jun 6 08:07:12 athen21 sshd[6824]: Failed password for illegal user test from 66.218.54.46 port 55936 s$
Jun 6 08:07:14 athen21 sshd[6826]: Illegal user network from 66.218.54.46
Jun 6 08:07:14 athen21 sshd[6826]: error: Could not get shadow information for NOUSER
Jun 6 08:07:14 athen21 sshd[6826]: Failed password for illegal user network from 66.218.54.46 port 5987$
Jun 6 08:07:14 athen21 sshd[6830]: Failed password for admin from 66.218.54.46 port 56452 ssh2
Jun 6 08:07:15 athen21 sshd[6831]: Illegal user webmaster from 66.218.54.46
Jun 6 08:07:15 athen21 sshd[6831]: error: Could not get shadow information for NOUSER
Jun 6 08:07:15 athen21 sshd[6831]: Failed password for illegal user webmaster from 66.218.54.46 port 55$
Jun 6 08:07:15 athen21 sshd[6834]: Illegal user word from 66.218.54.46
Jun 6 08:15:59 athen21 sshd[8428]: Failed password for admin from 66.218.54.46 port 35920 ssh2
Jun 6 08:16:00 athen21 sshd[8434]: Failed password for admin from 66.218.54.46 port 35934 ssh2
Jun 6 08:16:01 athen21 sshd[8438]: Failed password for admin from 66.218.54.46 port 35941 ssh2
Jun 6 08:16:03 athen21 sshd[8440]: Failed password for admin from 66.218.54.46 port 35954 ssh2
Jun 6 08:16:04 athen21 sshd[8444]: Failed password for admin from 66.218.54.46 port 35969 ssh2
Jun 6 08:16:05 athen21 sshd[8447]: Failed password for admin from 66.218.54.46 port 35978 ssh2
Jun 6 08:16:06 athen21 sshd[8452]: Failed password for admin from 66.218.54.46 port 35989 ssh2
Jun 6 08:16:07 athen21 sshd[8456]: Failed password for admin from 66.218.54.46 port 36003 ssh2
Jun 6 08:16:08 athen21 sshd[8460]: Failed password for admin from 66.218.54.46 port 36013 ssh2
Jun 6 08:16:09 athen21 sshd[8464]: Failed password for admin from 66.218.54.46 port 36025 ssh2
Jun 6 08:16:11 athen21 sshd[8466]: Failed password for admin from 66.218.54.46 port 36039 ssh2
Jun 6 08:16:12 athen21 sshd[8470]: Failed password for admin from 66.218.54.46 port 36047 ssh2
Jun 6 08:16:13 athen21 sshd[8474]: Failed password for admin from 66.218.54.46 port 36060 ssh2
usw.
Code: Select all
Jun 6 11:01:53 athen21 sshd[8022]: Accepted password for admin from 89.136.64.140 port 4589 ssh2
Jun 6 11:01:54 athen21 sshd[8069]: (pam_unix) session opened for user admin by (uid=0)
Jun 6 11:02:25 athen21 passwd[8108]: (pam_unix) authentication failure; logname=admin uid=1000 euid=0 t$
Jun 6 11:02:38 athen21 passwd[8121]: (pam_unix) password changed for admin
Jun 6 11:02:38 athen21 passwd[8121]: (pam_unix) Password for admin was changed
Jun 6 11:03:49 athen21 sshd[8230]: Accepted password for admin from 89.136.64.140 port 4592 ssh2
Code: Select all
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 600
PermitRootLogin yes
StrictModes yes
RSAAuthentication no
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to no to disable s/key passwords
ChallengeResponseAuthentication no
# Change to yes to enable tunnelled clear text passwords
PasswordAuthentication 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
X11Forwarding no
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
KeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
Subsystem sftp /usr/lib/sftp-server
UsePAM yes
Habt ihr weitere Sicherheitstipps? Bzw. gibt es eine Möglichkeit, ALLEN Usern des Servers ssh zu "verbieten" bis auf root mit dem Key?
Grüße