You are not logged in.

#1 2021-07-21 07:12:16

thomasbb
Member
Registered: 2020-05-22
Posts: 52

[SOLVED] ssh faillock

The steps are:
1. create a user with useradd
2. try to ssh with a fake password three times to have a Permission denied error
3. set a password to the user
4. retry to ssh with the right password: it should fail no matter what password is set

The new attempts to connect with ssh fail forever afterwards. Is it just me? On two users, I observed the same behavior.

If the password is set before the ssh attempt or if a fake password is not given three times, then ssh works as expected

Last edited by thomasbb (2021-07-21 14:13:31)

Offline

#2 2021-07-21 07:13:42

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,431

Offline

#3 2021-07-21 11:55:29

thomasbb
Member
Registered: 2020-05-22
Posts: 52

Re: [SOLVED] ssh faillock

But a su login works though...

Offline

#4 2021-07-21 11:59:30

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,630
Website

Re: [SOLVED] ssh faillock

ArchWiki wrote:

The lockout only applies to password authentication


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2021-07-21 12:02:12

thomasbb
Member
Registered: 2020-05-22
Posts: 52

Re: [SOLVED] ssh faillock

Here I have the opposite issue: the ssh login never works afterwards, but the su login goes well. If I understood the wiki well, it describes the situation where the user is locked out for login but ssh still works

Offline

#6 2021-07-21 13:07:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,431

Re: [SOLVED] ssh faillock

wiki wrote:

public key authentication over SSH is still accepted

Do you have a faillock entry and whyt happens when you reset it?

Offline

#7 2021-07-21 13:31:31

thomasbb
Member
Registered: 2020-05-22
Posts: 52

Re: [SOLVED] ssh faillock

What I do is:

  1. not initializing a password to the newly created user:

    1. create a user myuser, without setting a password with passwd to this myuser

    2. ssh myuser@localhost

    3. type 3 times a fake string

    4. set a password with passwd

    5. ssh myuser@localhost doesn't work

    6. su myuser works

  2. initializing a password to the newly created user:

    1. create a user myuser, set password with passwd to this myuser

    2. both ssh and su work with the set password

In either case, no key identification.

To summarize, if the password hasn't been set, the ssh command never recovers (or maybe after a timeout). It seems the wiki describes the opposite situation: the user is locked out but ssh still works

Offline

#8 2021-07-21 13:33:46

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,431

Re: [SOLVED] ssh faillock

It seems the wiki describes the opposite situation

No. Look at the goddamn faillock list and try to reset it, will you? Please?

Offline

#9 2021-07-21 13:35:41

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,678
Website

Re: [SOLVED] ssh faillock

You're still describing the intended behavior.
The faillock is applied depending on context.
SSH results in an RHOST lock:

# faillock
test:
When                Type  Source                                           Valid
2021-07-21 09:36:45 RHOST ::1                                                  V
2021-07-21 09:36:51 RHOST ::1                                                  V
2021-07-21 09:36:55 RHOST ::1                                                  V

While the local login results in a TTY lock:

# faillock
test:
When                Type  Source                                           Valid
2021-07-21 15:34:03 TTY   /dev/tty3                                            V
2021-07-21 15:34:10 TTY   /dev/tty3                                            V
2021-07-21 15:34:17 TTY   /dev/tty3                                            V

Edit: Ninja'd

Last edited by schard (2021-07-21 13:36:44)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#10 2021-07-21 14:11:14

thomasbb
Member
Registered: 2020-05-22
Posts: 52

Re: [SOLVED] ssh faillock

schard wrote:

The faillock is applied depending on context.

Of course, my bad... Thank you for giving it a try

Offline

Board footer

Powered by FluxBB