[GH-ISSUE #150] SSH breaks #62

Closed
opened 2026-03-03 13:58:50 +03:00 by kerem · 10 comments
Owner

Originally created by @0x-Stealth on GitHub (Jul 5, 2022).
Original GitHub issue: https://github.com/konstruktoid/hardening/issues/150

Originally assigned to: @konstruktoid on GitHub.

{{ tools.context.actor }}: {{ tools.context.sha }}
After running this script, you become unable to log into ssh, the port still works but nomatter what you put, it's always a Access Denied error, or max number of retries with always the right password

Originally created by @0x-Stealth on GitHub (Jul 5, 2022). Original GitHub issue: https://github.com/konstruktoid/hardening/issues/150 Originally assigned to: @konstruktoid on GitHub. {{ tools.context.actor }}: {{ tools.context.sha }} After running this script, you become unable to log into ssh, the port still works but nomatter what you put, it's always a Access Denied error, or max number of retries with always the right password
kerem closed this issue 2026-03-03 13:58:50 +03:00
Author
Owner

@0x-Stealth commented on GitHub (Jul 5, 2022):

VNC works perfect, but SSH just doesn't

<!-- gh-comment-id:1175592674 --> @0x-Stealth commented on GitHub (Jul 5, 2022): VNC works perfect, but SSH just doesn't
Author
Owner

@konstruktoid commented on GitHub (Jul 5, 2022):

Hi @Stealthr and thanks for reporting this.

Could you please include the sshd log with a failed login attempt?

<!-- gh-comment-id:1175594749 --> @konstruktoid commented on GitHub (Jul 5, 2022): Hi @Stealthr and thanks for reporting this. Could you please include the `sshd` log with a failed login attempt?
Author
Owner

@0x-Stealth commented on GitHub (Jul 5, 2022):

What do you mean?

<!-- gh-comment-id:1175601080 --> @0x-Stealth commented on GitHub (Jul 5, 2022): What do you mean?
Author
Owner

@konstruktoid commented on GitHub (Jul 6, 2022):

what is the actual error message? can you paste a log with a failed login attempt?
sudo journalctl -r -u ssh

<!-- gh-comment-id:1175913799 --> @konstruktoid commented on GitHub (Jul 6, 2022): what is the actual error message? can you paste a log with a failed login attempt? `sudo journalctl -r -u ssh`
Author
Owner

@0x-Stealth commented on GitHub (Jul 9, 2022):

I physically cannot connect to the server, unless I remove the UFW rule, then I still really can't connect to it because I can't sign in. I'll send a lon in a sec @konstruktoid

<!-- gh-comment-id:1179447637 --> @0x-Stealth commented on GitHub (Jul 9, 2022): I physically cannot connect to the server, unless I remove the UFW rule, then I still really can't connect to it because I can't sign in. I'll send a lon in a sec @konstruktoid
Author
Owner

@0x-Stealth commented on GitHub (Jul 9, 2022):

Jul 09 02:35:37 vmi855967.contaboserver.net sshd[3970]: Connection closed by invalid user support 179.60.147.74 port 30374 [preauth]
Jul 09 02:35:34 vmi855967.contaboserver.net sshd[3970]: Failed password for invalid user support from 179.60.147.74 port 30374 ssh2
Jul 09 02:35:32 vmi855967.contaboserver.net sshd[3970]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=179.60.147.74
Jul 09 02:35:32 vmi855967.contaboserver.net sshd[3970]: pam_unix(sshd:auth): check pass; user unknown
Jul 09 02:35:32 vmi855967.contaboserver.net sshd[3970]: Invalid user support from 179.60.147.74 port 30374
Jul 09 02:30:53 vmi855967.contaboserver.net sshd[3967]: Connection closed by 106.12.163.64 port 56470 [preauth]
Jul 09 02:27:08 vmi855967.contaboserver.net sshd[3963]: Connection closed by invalid user admin 114.35.118.190 port 50890 [preauth]
Jul 09 02:27:02 vmi855967.contaboserver.net sshd[3963]: Failed password for invalid user admin from 114.35.118.190 port 50890 ssh2
Jul 09 02:27:00 vmi855967.contaboserver.net sshd[3963]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=114.35.118.190
Jul 09 02:27:00 vmi855967.contaboserver.net sshd[3963]: pam_unix(sshd:auth): check pass; user unknown
Jul 09 02:27:00 vmi855967.contaboserver.net sshd[3963]: Invalid user admin from 114.35.118.190 port 50890
Jul 09 02:24:44 vmi855967.contaboserver.net sshd[3960]: Connection closed by authenticating user root 186.147.160.189 port 52920 [preauth]
Jul 09 02:24:43 vmi855967.contaboserver.net sshd[3960]: Failed password for root from 186.147.160.189 port 52920 ssh2
Jul 09 02:24:41 vmi855967.contaboserver.net sshd[3960]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=186.147.160.189 user=root
Jul 09 02:19:32 vmi855967.contaboserver.net sshd[3957]: Connection closed by invalid user admin 59.5.105.172 port 56925 [preauth]
Jul 09 02:19:29 vmi855967.contaboserver.net sshd[3957]: Failed password for invalid user admin from 59.5.105.172 port 56925 ssh2
Jul 09 02:19:27 vmi855967.contaboserver.net sshd[3957]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=59.5.105.172
Jul 09 02:19:27 vmi855967.contaboserver.net sshd[3957]: pam_unix(sshd:auth): check pass; user unknown
Jul 09 02:19:27 vmi855967.contaboserver.net sshd[3957]: Invalid user admin from 59.5.105.172 port 56925
Jul 09 02:19:16 vmi855967.contaboserver.net sshd[3955]: Disconnecting invalid user oracle 210.246.47.176 port 49274: Change of username or service not allowed: (oracle,ssh-connection>
Jul 09 02:19:13 vmi855967.contaboserver.net sshd[3955]: Failed password for invalid user oracle from 210.246.47.176 port 49274 ssh2
Jul 09 02:19:11 vmi855967.contaboserver.net sshd[3955]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=210.246.47.176
Jul 09 02:19:11 vmi855967.contaboserver.net sshd[3955]: pam_unix(sshd:auth): check pass; user unknown
Jul 09 02:19:11 vmi855967.contaboserver.net sshd[3955]: Invalid user oracle from 210.246.47.176 port 49274
Jul 09 02:02:58 vmi855967.contaboserver.net sshd[3938]: Connection closed by invalid user support 179.60.147.74 port 61124 [preauth]

<!-- gh-comment-id:1179452238 --> @0x-Stealth commented on GitHub (Jul 9, 2022): Jul 09 02:35:37 vmi855967.contaboserver.net sshd[3970]: Connection closed by invalid user support 179.60.147.74 port 30374 [preauth] Jul 09 02:35:34 vmi855967.contaboserver.net sshd[3970]: Failed password for invalid user support from 179.60.147.74 port 30374 ssh2 Jul 09 02:35:32 vmi855967.contaboserver.net sshd[3970]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=179.60.147.74 Jul 09 02:35:32 vmi855967.contaboserver.net sshd[3970]: pam_unix(sshd:auth): check pass; user unknown Jul 09 02:35:32 vmi855967.contaboserver.net sshd[3970]: Invalid user support from 179.60.147.74 port 30374 Jul 09 02:30:53 vmi855967.contaboserver.net sshd[3967]: Connection closed by 106.12.163.64 port 56470 [preauth] Jul 09 02:27:08 vmi855967.contaboserver.net sshd[3963]: Connection closed by invalid user admin 114.35.118.190 port 50890 [preauth] Jul 09 02:27:02 vmi855967.contaboserver.net sshd[3963]: Failed password for invalid user admin from 114.35.118.190 port 50890 ssh2 Jul 09 02:27:00 vmi855967.contaboserver.net sshd[3963]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=114.35.118.190 Jul 09 02:27:00 vmi855967.contaboserver.net sshd[3963]: pam_unix(sshd:auth): check pass; user unknown Jul 09 02:27:00 vmi855967.contaboserver.net sshd[3963]: Invalid user admin from 114.35.118.190 port 50890 Jul 09 02:24:44 vmi855967.contaboserver.net sshd[3960]: Connection closed by authenticating user root 186.147.160.189 port 52920 [preauth] Jul 09 02:24:43 vmi855967.contaboserver.net sshd[3960]: Failed password for root from 186.147.160.189 port 52920 ssh2 Jul 09 02:24:41 vmi855967.contaboserver.net sshd[3960]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=186.147.160.189 user=root Jul 09 02:19:32 vmi855967.contaboserver.net sshd[3957]: Connection closed by invalid user admin 59.5.105.172 port 56925 [preauth] Jul 09 02:19:29 vmi855967.contaboserver.net sshd[3957]: Failed password for invalid user admin from 59.5.105.172 port 56925 ssh2 Jul 09 02:19:27 vmi855967.contaboserver.net sshd[3957]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=59.5.105.172 Jul 09 02:19:27 vmi855967.contaboserver.net sshd[3957]: pam_unix(sshd:auth): check pass; user unknown Jul 09 02:19:27 vmi855967.contaboserver.net sshd[3957]: Invalid user admin from 59.5.105.172 port 56925 Jul 09 02:19:16 vmi855967.contaboserver.net sshd[3955]: Disconnecting invalid user oracle 210.246.47.176 port 49274: Change of username or service not allowed: (oracle,ssh-connection> Jul 09 02:19:13 vmi855967.contaboserver.net sshd[3955]: Failed password for invalid user oracle from 210.246.47.176 port 49274 ssh2 Jul 09 02:19:11 vmi855967.contaboserver.net sshd[3955]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=210.246.47.176 Jul 09 02:19:11 vmi855967.contaboserver.net sshd[3955]: pam_unix(sshd:auth): check pass; user unknown Jul 09 02:19:11 vmi855967.contaboserver.net sshd[3955]: Invalid user oracle from 210.246.47.176 port 49274 Jul 09 02:02:58 vmi855967.contaboserver.net sshd[3938]: Connection closed by invalid user support 179.60.147.74 port 61124 [preauth]
Author
Owner

@konstruktoid commented on GitHub (Jul 9, 2022):

I assume that's a public server due to all various usernames logging in.

Have you added the user group of the user you're trying to log in with to SSH_GRPS and have you added the IP or IP-range the user is allowed to logged in from to FW_ADMIN?

<!-- gh-comment-id:1179487654 --> @konstruktoid commented on GitHub (Jul 9, 2022): I assume that's a public server due to all various usernames logging in. Have you added the user group of the user you're trying to log in with to `SSH_GRPS` and have you added the IP or IP-range the user is allowed to logged in from to `FW_ADMIN`?
Author
Owner

@0x-Stealth commented on GitHub (Jul 9, 2022):

it's not even public, just realised people wee prob trying to bruteforce or smth, but it's irrelevant rn, idk what SSH_GRPS or how to add anything to it or what the oher thing is

<!-- gh-comment-id:1179530344 --> @0x-Stealth commented on GitHub (Jul 9, 2022): it's not even public, just realised people wee prob trying to bruteforce or smth, but it's irrelevant rn, idk what SSH_GRPS or how to add anything to it or what the oher thing is
Author
Owner

@konstruktoid commented on GitHub (Jul 9, 2022):

If someone or something is able to connect to your server trying to bruteforce and login, then it's most likely public.

The two variables are described in the documentation: https://github.com/konstruktoid/hardening#configuration-options

<!-- gh-comment-id:1179606032 --> @konstruktoid commented on GitHub (Jul 9, 2022): If someone or something is able to connect to your server trying to bruteforce and login, then it's most likely public. The two variables are described in the documentation: https://github.com/konstruktoid/hardening#configuration-options
Author
Owner

@konstruktoid commented on GitHub (Jul 14, 2022):

Closing since the necessary options are described in the documentation.

<!-- gh-comment-id:1184603781 --> @konstruktoid commented on GitHub (Jul 14, 2022): Closing since the necessary options are described in the documentation.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hardening#62
No description provided.