Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 834040 - default sshd_config doesn't allow password logins
Summary: default sshd_config doesn't allow password logins
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: InstallCD (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Release Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-25 17:35 UTC by Fabian Groffen
Modified: 2022-02-27 09:18 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2022-02-25 17:35:19 UTC
/etc/ssh/sshd_config has this bit:

# Allow root login with password on livecds.
PermitRootLogin Yes

however, it also has:

# To disable tunneled clear text passwords, change to no here!                
PasswordAuthentication no                                                     
#PermitEmptyPasswords no

With PasswordAuthentication no one cannot login using a password, which makes it all a bit complicated to setup, so I would suggest commenting out PasswordAuthentication such that one can ssh with password as root to the livecd-booted box.

Reproducible: Always

Steps to Reproduce:
1.boot livecd
2.passwd (to something you know)
3./etc/init.d/sshd start
4.(from remote) ssh root@livecd-host  (fails, password auth not allowed)


Expected Results:  
since we allow root to login, that we can actually login via set password
Comment 1 Ben Kohler gentoo-dev 2022-02-25 18:00:28 UTC
I think you have something else going wrong, I just tested on install-amd64-minimal-20220220T170542Z.iso and this is working fine.  I did have to set a pretty complex password due to passwdqc default requirements.

That "PasswordAuthentication no" does not actually disable password auth since we have USE=pam enabled.
Comment 2 Fabian Groffen gentoo-dev 2022-02-25 18:21:58 UTC
Odd, I'm booted into the box right now, and the only way for me to ssh into it, was enabling the setting.

Feb 25 17:26:53 livecd sshd[9624]: Connection closed by authenticating user root
 x.y.z.a port 35176 [preauth]

% ssh root@x.y.z.a
root@x.y.z.a: Permission denied (publickey,keyboard-interactive).

enabling the setting, restarting sshd and

Feb 25 17:29:48 livecd sshd[9776]: Accepted password for root from x.y.z.b p
ort 35178 ssh2
Feb 25 17:29:48 livecd sshd[9776]: pam_unix(sshd:session): session opened for us
er root(uid=0) by (uid=0)

% ssh root@x.y.z.a
root@x.y.z.a's password:
Welcome to the Gentoo Linux Minimal Installation CD!
...
Comment 3 Ben Kohler gentoo-dev 2022-02-25 18:41:18 UTC
Which exact installcd is this?
Comment 4 Fabian Groffen gentoo-dev 2022-02-25 18:56:57 UTC
install-amd64-minimal-20220220T170542Z.iso
Comment 5 Fabian Groffen gentoo-dev 2022-02-27 09:18:12 UTC
ok, problem/workaround found, keyboard-interactive works, password doesn't.

Not sure what the difference is, but this works for me.

ssh -o PreferredAuthentications=keyboard-interactive root@<livecd>