LINUX.ORG.RU
Ответ на: комментарий от kravzo

вот что изменилось, как мне кажется

Перестала работать директива AllowUsers. До сортировки конфига sshd_config, в журнале /var/log/auth.log я наблюдал такое:

Aug 31 18:37:52 srvr sshd[3625]: Did not receive identification string from 185.93.185.7
Aug 31 18:38:01 srvr sshd[3626]: User root from 185.93.185.7 not allowed because not listed in AllowUsers
Aug 31 18:38:01 srvr sshd[3626]: input_userauth_request: invalid user root [preauth]
Aug 31 18:38:01 srvr sshd[3626]: Connection closed by 185.93.185.7 port 54002 [preauth]
Aug 31 18:38:31 srvr sshd[3628]: User root from 121.18.238.32 not allowed because not listed in AllowUsers
Aug 31 18:38:31 srvr sshd[3628]: input_userauth_request: invalid user root [preauth]
Aug 31 18:38:31 srvr sshd[3628]: Received disconnect from 121.18.238.32 port 45812:11:  [preauth]
Aug 31 18:38:31 srvr sshd[3628]: Disconnected from 121.18.238.32 port 45812 [preauth]

Видно, что директива AllowUsers отрабатывала отлично! А вот что теперь в журнале:

Sep  2 08:43:01 srvr sshd[4620]: Invalid user support from 204.12.248.115
Sep  2 08:43:01 srvr sshd[4620]: input_userauth_request: invalid user support [preauth]
Sep  2 08:43:02 srvr sshd[4620]: error: Received disconnect from 204.12.248.115 port 41824:3: com.jcraft.jsch.JSchException: Auth fail [preauth]
Sep  2 08:43:02 srvr sshd[4620]: Disconnected from 204.12.248.115 port 41824 [preauth]
Sep  2 08:43:03 srvr sshd[4622]: Invalid user admin from 204.12.248.115
Sep  2 08:43:03 srvr sshd[4622]: input_userauth_request: invalid user admin [preauth]
Sep  2 08:43:04 srvr sshd[4622]: error: Received disconnect from 204.12.248.115 port 61045:3: com.jcraft.jsch.JSchException: Auth fail [preauth]
Sep  2 08:43:04 srvr sshd[4622]: Disconnected from 204.12.248.115 port 61045 [preauth]
Sep  2 08:43:07 srvr sshd[4624]: User root not allowed because account is locked
Sep  2 08:43:07 srvr sshd[4624]: input_userauth_request: invalid user root [preauth]
Sep  2 08:43:07 srvr sshd[4624]: error: Received disconnect from 204.12.248.115 port 2514:3: com.jcraft.jsch.JSchException: Auth fail [preauth]
Sep  2 08:43:07 srvr sshd[4624]: Disconnected from 204.12.248.115 port 2514 [preauth]
Кто-то ломится с именами support, admin, root а директива AllowUsers не отрабатывает.
AllowUsers содержит всего одно имя: AllowUsers username

InvisibleLight
() автор топика
Ответ на: комментарий от kravzo

Очевидно же, ТС воспользовался вашим патчем из другой темы про iptables sort :)
TC - действительно покажите конфиг, порядок строк может иметь значение (именно может но не обязательно, зависит от используемых настроек). А вообще конечно вы ссзб, делать что-то не представляя к каким последствиям это приведет...и немного не мало на sshd, поколение мышкотыкателей...

anc ★★★★★
()
Ответ на: комментарий от kravzo

вот мой конфиг

#a
AllowUsers username <- конечно же имя реального пользователя я заменил на username
AddressFamily inet
AcceptEnv LANG LC_*
#b
#c
ChallengeResponseAuthentication no
ClientAliveInterval 300
ClientAliveCountMax 0
#d
#e
#f
#g
#h
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
HostbasedAuthentication no
#i
IgnoreRhosts yes
#j
#k
KeyRegenerationInterval 3600
#l
LogLevel INFO
LoginGraceTime 120
#m
MaxAuthTries 2
MaxStartups 2
#n
#o
#p
PasswordAuthentication no
Port 22
Protocol 2
PermitRootLogin no
PubkeyAuthentication yes
PermitEmptyPasswords no
PrintMotd no
PrintLastLog yes
#q
#r
RSAAuthentication yes
RhostsRSAAuthentication no
#s
StrictModes yes
ServerKeyBits 1024
SyslogFacility AUTH
StrictModes yes
Subsystem sftp /usr/lib/openssh/sftp-server
#t
TCPKeepAlive yes
#u
UsePrivilegeSeparation yes
UsePAM no
#v
#w
#x
X11Forwarding no
X11DisplayOffset 10
#y
#z
InvisibleLight
() автор топика
Ответ на: комментарий от anc

я показал свой конфиг

почему после сортировки строк в sshd_config перестала отрабатывать директива AllowUsers ? это правильно? может и правильно, но никто пока не дал понятного объяснения. да, я из мышкокликателя пытаюсь перерасти в красноглазика и у меня не всё получается, ну уж простите ;-) Потерпите пожалуйста :)

InvisibleLight
() автор топика
Ответ на: я показал свой конфиг от InvisibleLight

Ну вроде блоков Match нэма (про другие я хз) и на первый взгляд ничего криминального. Посмотрите при старте sshd он случайно не ругается ли на ошибки в конфиге.

anc ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.