LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > slarm64
User Name
Password
slarm64 This forum is for the discussion of slarm64.

Notices


Reply
  Search this Thread
Old 06-12-2022, 03:28 PM   #1
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Rep: Reputation: Disabled
Question ssh login not possible if UsePAM is set to yes


Dear Members,

I'm in a situation where I have a NanoPI R4S with Slarm64-current installed, and I want to log in with a password via SSH (given that it's a headless system).

My problem is that I get the following error when UsePAM is set to yes in the sshd_config. If I set it to no, and restart sshd, then I can log in just fine.
The error message is:

Code:
$ ssh -o UserKnownHostsFile=/dev/null -l user 192.168.10.24
The authenticity of host '192.168.A.B (192.168.A.B)' can't be established.
ECDSA key fingerprint is SHA256:XXXX.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.A.B' (ECDSA) to the list of known hosts.
Password: 
client_loop: send disconnect: Broken pipe
On the server side, I can see:

Code:
debug3: mm_request_send: entering, type 26 [preauth]
debug3: mm_send_keystate: Finished sending state [preauth]
debug1: monitor_read_log: child log fd closed
debug3: ssh_sandbox_parent_finish: finished
debug1: PAM: establishing credentials
PAM: pam_setcred(): Authentication failure
debug1: do_cleanup
debug3: PAM: sshpam_thread_cleanup entering
What may the problem be?
 
Old 06-12-2022, 03:41 PM   #2
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 1,917

Rep: Reputation: Disabled
Hi wowbaggerHU,

What does the file look like /etc/pam.d/sshd
And is there no sshd.new file?
 
Old 06-12-2022, 03:44 PM   #3
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sndwvs View Post
What does the file look like /etc/pam.d/sshd
And is there no sshd.new file?
Code:
root@nanopi-r4s:/etc/pam.d# cat sshd 
#%PAM-1.0
# pam_securetty.so is commented out since sshd already does a good job of
# protecting itself. You may uncomment it if you like, but then you may
# need to add additional consoles to /etc/securetty if you want to allow
# root logins on them, such as: ssh, pts/0, :0, etc
#auth            required        pam_securetty.so
# When using pam_faillock, print a message to the user if the account is
# locked. This lets the user know what is going on, but it also potentially
# gives additional information to attackers:
#auth            requisite       pam_faillock.so preauth
auth            include         system-auth
# To set a limit on failed authentications, the pam_faillock module
# can be enabled. See pam_faillock(8) for more information.
#auth            [default=die]   pam_faillock.so authfail
#auth            sufficient      pam_faillock.so authsucc
auth            include         postlogin
account         required        pam_nologin.so
account         include         system-auth
password        include         system-auth
session         include         system-auth
session         include         postlogin
session         required        pam_loginuid.so
-session        optional        pam_elogind.so

root@nanopi-r4s:/etc/pam.d# ls -l         
total 108
-rw-r--r-- 1 root root  146 Feb 19  2020 chage
-rw-r--r-- 1 root root  192 Feb 14  2020 chfn
-rw-r--r-- 1 root root  146 Feb 19  2020 chgpasswd
-rw-r--r-- 1 root root  146 Feb 19  2020 chpasswd
-rw-r--r-- 1 root root  192 Feb 14  2020 chsh
-rw-r--r-- 1 root root  244 Mar  4  2021 elogind-user
-rw-r--r-- 1 root root  146 Feb 19  2020 groupadd
-rw-r--r-- 1 root root  146 Feb 19  2020 groupdel
-rw-r--r-- 1 root root  146 Feb 19  2020 groupmems
-rw-r--r-- 1 root root  146 Feb 19  2020 groupmod
-rw-r--r-- 1 root root 1014 Jun 18  2020 login
-rw-r--r-- 1 root root  146 Feb 19  2020 newusers
-rw-r--r-- 1 root root  155 Nov  8  2018 other
-rw-r--r-- 1 root root  186 Feb 19  2020 passwd
-rw-r--r-- 1 root root  231 Nov 15  2018 postlogin
-rw-r--r-- 1 root root  183 Feb 20  2021 ppp
-rw-r--r-- 1 root root  200 Feb 19  2020 runuser
-rw-r--r-- 1 root root  150 Feb 19  2020 runuser-l
-rw-r--r-- 1 root root   77 Feb  2 19:10 screen
-rw-r--r-- 1 root root 1228 Apr 17 13:22 sshd
-rw-r--r-- 1 root root  545 Feb 19  2020 su
-rw-r--r-- 1 root root  210 Feb 19  2020 su-l
-rw-r--r-- 1 root root 2443 Jun 16  2020 system-auth
-rw-r--r-- 1 root root  146 Feb 19  2020 useradd
-rw-r--r-- 1 root root  146 Feb 19  2020 userdel
-rw-r--r-- 1 root root  146 Feb 19  2020 usermod
-rw-r--r-- 1 root root  314 Aug  5  2021 vsftpd
root@nanopi-r4s:/etc/pam.d#
 
Old 06-12-2022, 04:00 PM   #4
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 1,917

Rep: Reputation: Disabled
Аnd if you try to do it on x86_64 too?
 
Old 06-12-2022, 04:03 PM   #5
wowbaggerHU
Member
 
Registered: Feb 2017
Location: Hungary
Distribution: Slackware
Posts: 288

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sndwvs View Post
Аnd if you try to do it on x86_64 too?
Interestingly enough, it seems to work there...
That's what got me too. AFAIK the configurations are almost identical. The Aarch64 is more permissive as I modified /etc/security/access.conf to allow root and me:

Code:
+:root:192.168.0.0/16
+:janos:192.168.0.0/16
But on x86_64, it seems to work even without that.
 
  


Reply

Tags
ssh pam



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Copying your Public SSH Key to a Server with SSH-Copy-ID when the server is already set with 'PubkeyAuthentication yes' Liniub Linux - Newbie 4 05-02-2020 12:15 PM
Yes Puppy Yes! Todd873 Puppy 4 08-30-2006 04:31 AM
3D acceleration YES YES YES glxgears results props666999 Slackware 44 07-29-2005 08:40 PM
Yes Yes Yes! I Got Sound! shazam75 LinuxQuestions.org Member Success Stories 2 10-14-2004 04:11 AM
Midi: yes, Mix: yes, Wav: NO J_Szucs Linux - Newbie 1 11-05-2001 08:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > slarm64

All times are GMT -5. The time now is 09:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration