centos-ssh icon indicating copy to clipboard operation
centos-ssh copied to clipboard

SSH_USER variable not working

Open Pavo-IM opened this issue 3 years ago • 3 comments

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

Pavo-IM avatar Nov 10 '21 15:11 Pavo-IM

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

Ref: https://github.com/jdeathe/centos-ssh/blob/378c503b1b240609e8a9d012e3ec74f5f5998e40/src/usr/sbin/sshd-bootstrap#L744

jdeathe avatar Nov 10 '21 18:11 jdeathe

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

Ref:

https://github.com/jdeathe/centos-ssh/blob/378c503b1b240609e8a9d012e3ec74f5f5998e40/src/usr/sbin/sshd-bootstrap#L744

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

Pavo-IM avatar Nov 11 '21 14:11 Pavo-IM

@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_.$-]?

jdeathe avatar Nov 17 '21 09:11 jdeathe