LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-28-2022, 07:55 AM   #1
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Rep: Reputation: 35
Question [OpenSSHd] Why prompted for passphrase on one server but not others?


Hello,

Using the same public+private set of keys, unlike other servers in the lab, when connecting from Windows with the Kitty terminal application to a new Debian 11 host, I'm prompted for the passphrase:

Code:
Using username "root".
Authenticating with public key "Generated by joe@JOE-PC."
Passphrase for key "Generated by joe@JOE-PC.":
Before removing the passphrase as a quick work-around, I'd like to understand why this happens, as I don't see differences on the server and the client sides that might explain the difference in behavior.

FWIW, it's OpenSSH_8.4p1

Thank you.
 
Old 10-28-2022, 08:19 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,635

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
You might check the permissions and ownership on the /home, home folder, ~/.ssh and its files, and on the /etc/ssh folder and files.
SSH will, and change its behavior due to differences in those permissions and ownership.
 
Old 10-28-2022, 08:52 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,311
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Passphrases and, for that matter, private keys have nothing to do with the server. Neither the passphrase nor the key itself ever leave the client. The authentication process uses them in a different way. Thus if the client is a legacy system with Windows and it is the only one misbehaving then what you have is a Windows problem, maybe check with a Windows forum instead.

But since you ask here, my approach would be to back up the client data, download Linux Mint, wipe the client hard drive with a fresh install of Linux Mint, and then restore the backed up data into that fresh installation. That will save a lot of work over time anyway. From there check about what kind of SSH agent you have running and whether the private key is loaded into it, some of that can be configured in ~/.ssh/config.
 
Old 10-28-2022, 09:31 AM   #4
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Original Poster
Rep: Reputation: 35
(snip since can't delete error)

Last edited by littlebigman; 10-28-2022 at 09:36 AM.
 
Old 10-28-2022, 09:35 AM   #5
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Original Poster
Rep: Reputation: 35
Thanks for the tip.

Here's /etc/ssh/sshd_config:
Code:
-rw-r--r--  1 root root   3357 Oct 28 14:16 sshd_config
root's .ssh/authorized_keys
Code:
-rw------- 1 root root  577 Oct 28 14:46 authorized_keys
and the contents of sshd_config:
Code:
~# grep -v '#' sshd_config

Include /etc/ssh/sshd_config.d/*.conf
PubkeyAuthentication yes
RSAAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem       sftp    /usr/lib/openssh/sftp-server

Last edited by littlebigman; 10-28-2022 at 09:36 AM.
 
Old 10-28-2022, 09:46 AM   #6
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,635

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
You have multiple hosts and one client. Are those folders and files on the client, a host with the behavior, or a host without the behavior?
You need to be very specific and clear here, because you are dealing with security software with very specific requirements and behavior.
 
Old 10-28-2022, 10:09 AM   #7
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Original Poster
Rep: Reputation: 35
Those files above are on the Debian host.

The behavior occurs only with that freshly installed Debian 11 host, connecting from a Windows client that works fine with other Linux servers.

Being prompted for the passphrase is no biggie, but enough to want to turn off that "feature", especially since it doesn't occur when connecting to other Linux servers.
 
Old 10-28-2022, 10:33 AM   #8
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Original Poster
Rep: Reputation: 35
Found it: I was using a copy of the private key elsewhere, that might have its passphrase disabled (I don't know how to tell.)

Pointing the SSH client to that other file solved the issue.

Thanks all.

--
Edit: To check if the private key is passphrase-protected, check what it says for "Encryption".
Attached Thumbnails
Click image for larger version

Name:	C8097E12-BFF9-41C6-BD7D-B98BBBADD5C0.png
Views:	3
Size:	27.0 KB
ID:	39780  

Last edited by littlebigman; 10-28-2022 at 10:37 AM.
 
1 members found this post helpful.
Old 10-28-2022, 05:47 PM   #9
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,451
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Quote:
Originally Posted by littlebigman View Post
Hello,

Using the same public+private set of keys, unlike other servers in the lab, when connecting from Windows with the Kitty terminal application to a new Debian 11 host, I'm prompted for the passphrase:
Not sure if you know this, or even if you're interested, but Windows comes with OpenSSH client built in. You can just open a cmd prompt and type:

Code:
ssh user@ip_address
et viola
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[make] Why prompted after change? littlebigman Programming 0 03-29-2011 09:46 AM
Disabeling Shell Access in OpenSSHd wwnexc Linux - Software 1 02-14-2006 02:03 PM
Restricting Port Forwarding over OpenSSHd wwnexc Linux - Software 1 01-24-2006 10:15 AM
2 quick questions: ProFTPd and OpenSSHd Ankheg Linux - Security 6 08-06-2004 01:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:38 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