Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

SSH_USER variable not working #907

Open
Pavo-IM opened this issue Nov 10, 2021 · 3 comments
Open

SSH_USER variable not working #907

Pavo-IM opened this issue Nov 10, 2021 · 3 comments

Comments

@Pavo-IM
Copy link

Pavo-IM commented Nov 10, 2021

Screen Shot 2021-11-10 at 10 53 37 AM

@jdeathe
Copy link
Owner

jdeathe commented Nov 10, 2021

@Pavo-IM This is expected; the value used for SSH_USER didn’t validate. Try without an uppercase character.

Ref:

local -r safe_user='^[a-z_][a-z0-9_-]{0,29}[$a-z0-9_]?$'

@Pavo-IM
Copy link
Author

Pavo-IM commented Nov 11, 2021

@Pavo-IM This is expected; the value used for SSH_USER didn’t validate. Try without an uppercase character.

Ref:

local -r safe_user='^[a-z_][a-z0-9_-]{0,29}[$a-z0-9_]?$'

Works, thanks but is there anyway to add upper and lower case username support?

@jdeathe
Copy link
Owner

jdeathe commented Nov 17, 2021

@Pavo-IM This validation was based on the following standards based validation routine:

Ref: https://github.com/shadow-maint/shadow/blob/4.6/man/useradd.8.xml#L639-L661

However, looking into the source of the shadow rpm for CentOS 7 the user name validation is less restrictive by way of a patch to is_valid_name.

Ref: https://git.centos.org/rpms/shadow-utils/blob/c7/f/SOURCES/shadow-4.5-goodname.patch#_16-23

[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants