LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-18-2023, 10:03 AM   #1
sag2662
Member
 
Registered: Sep 2022
Posts: 74

Rep: Reputation: 0
user password doesnot work via ssh


Hi all,
I am trying to connect to the client from server with the user test. on the client i have added user "test" and from the server, i am trying to connect to client via ssh as below

Code:
root@server:/home# su - test
$ ssh client1
The authenticity of host 'client1 (172.67.8.90)' can't be established.
ED25519 key fingerprint is SHA256:PpN7cwhwwfd59H9yPtUhIv7hP7B8/IH9Fc2OXWX8dlo.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'client1 ' (ED25519) to the list of known hosts.
Unauthorized access to this machine is prohibited
Press <Ctrl-D> if you are not an authorized user
(test@client1) Password:
Connection closed by 172.67.8.90 port 22
though I give the right password it doesnot take at all. what could be the issue?
where am i going wrong.please suggest

Last edited by sag2662; 01-18-2023 at 10:04 AM.
 
Old 01-18-2023, 10:12 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
That looks normal, if it were roort. Most systems allow only either key-based or certificate-based login for root. Try logging in as another user or else make and install a key pair for root. However it is usually a bad idea to allow remote login for root and most tasks can be accomplished by other means. What problem are you trying to solve?

Edit: misread the first line. See the -v -v -v suggestion instead.

Last edited by Turbocapitalist; 01-18-2023 at 10:14 AM.
 
Old 01-18-2023, 10:13 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,967

Rep: Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333
you might want to use ssh -vvv <host> to see what's going on. We don't know the configuration so we can hardly find the root cause. Would be nice to give us more details.
 
Old 01-18-2023, 10:17 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
The relevant lines from the client configuration file ~/.ssh/config might help too, if it is in use.

If you want to see the full set of options as they are going to be applied to that particular session, see the -G option for the SSH client:

Code:
ssh -G test@client1 | sort | less
 
Old 01-18-2023, 11:03 AM   #5
sag2662
Member
 
Registered: Sep 2022
Posts: 74

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
you might want to use ssh -vvv <host> to see what's going on. We don't know the configuration so we can hardly find the root cause. Would be nice to give us more details.
yes i ran in verbose mode it always asks me to issue password, but it doesnot accept password, but from the client i can always switch as test user.
 
Old 01-18-2023, 11:08 AM   #6
sag2662
Member
 
Registered: Sep 2022
Posts: 74

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Turbocapitalist View Post
The relevant lines from the client configuration file ~/.ssh/config might help too, if it is in use.

If you want to see the full set of options as they are going to be applied to that particular session, see the -G option for the SSH client:

Code:
ssh -G test@client1 | sort | less
is there any particular option that i could look for ?

Code:
user test
userknownhostsfile /home/test.ssh/known_hosts /home/test/.ssh/known_hosts2
verifyhostkeydns false
 
Old 01-18-2023, 11:08 AM   #7
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,483

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Check that the remote system actually allows password based logins. It may be configured for key-pair only.
 
Old 01-18-2023, 11:40 AM   #8
lvm_
Member
 
Registered: Jul 2020
Posts: 955

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
If anything at all involving client-server interaction not working as expected you should start by analysing server logs - do it. OpenSSH log is in /var/log/auth.log, you might want to increase log verbosity using LogLevel directive in /etc/ssh/sshd_config.

Last edited by lvm_; 01-19-2023 at 03:16 AM.
 
Old 01-18-2023, 11:45 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,967

Rep: Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333Reputation: 7333
Quote:
Originally Posted by sag2662 View Post
yes i ran in verbose mode it always asks me to issue password, but it doesnot accept password, but from the client i can always switch as test user.
and it is still not enough to help you. You need to either show us the config and the real commands (how did you execute, what and what was the response) or check the log files on both sides.
 
Old 01-19-2023, 01:34 PM   #10
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
OP is connecting “from server to client”…
Is sshd configured and running on the client? I’m guessing not.
ssh is a one-way process. Being able to connect from machine A to machine B does not mean you can connect from machine B to machine A. You’d need to set up sshd on the “client” machine to be able to connect to it (at which time, the “server” will become the client and vice versa)

Last edited by scasey; 01-19-2023 at 01:36 PM.
 
Old 01-19-2023, 01:55 PM   #11
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
Quote:
Originally Posted by scasey View Post
OP is connecting “from server to client”…
Is sshd configured and running on the client? I’m guessing not.
It did connect, it just did not authenticate. Checking sshd's logs on the system receiving the connection would be the way to go, as mentioned in post #8 above.
 
Old 01-20-2023, 01:53 AM   #12
sag2662
Member
 
Registered: Sep 2022
Posts: 74

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by scasey View Post
OP is connecting “from server to client”…
Is sshd configured and running on the client? I’m guessing not.
ssh is a one-way process. Being able to connect from machine A to machine B does not mean you can connect from machine B to machine A. You’d need to set up sshd on the “client” machine to be able to connect to it (at which time, the “server” will become the client and vice versa)

sshd is configured and it justs works fine from another machines.
 
Old 01-20-2023, 02:58 AM   #13
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
Quote:
Originally Posted by sag2662 View Post
sshd is configured and it justs works fine from another machines.
Then try tracking what's going on with the connection from the one specific client by setting up a one-off SSH session. On the system being connected to:

Code:
/usr/sbin/sshd -p 2222 -d -d -E /tmp/server1.ssh.log
Then on the system you are connecting from:

Code:
ssh -p 2222 -v -E /tmp/client1.ssh.log test@client1
That will allow one single attempt at connecting. On the server, the output from sshd will be saved in /tmp/server1.ssh.log and on the client the output will be save in /tmp/client1.ssh.log and both will contain information from only the single session attempt.
 
Old 01-20-2023, 04:01 AM   #14
sag2662
Member
 
Registered: Sep 2022
Posts: 74

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Turbocapitalist View Post
Then try tracking what's going on with the connection from the one specific client by setting up a one-off SSH session. On the system being connected to:

Code:
/usr/sbin/sshd -p 2222 -d -d -E /tmp/server1.ssh.log
Then on the system you are connecting from:

Code:
ssh -p 2222 -v -E /tmp/client1.ssh.log test@client1
That will allow one single attempt at connecting. On the server, the output from sshd will be saved in /tmp/server1.ssh.log and on the client the output will be save in /tmp/client1.ssh.log and both will contain information from only the single session attempt.

Thank you. I ran this on server and client side and I have the following. Says too many authentication failures. may be i create new user on server and client and try again

on client1:
Code:
PAM: Authentication failure for illegal user test from "172.60.20.15"
Failed:/keyboard-interactive/pam for invalid user test from "172.67.8.90" port 54264 ssh2
Disconnecting invalid user test port 54264:Too many authentication failures

on server1:
Code:
Disconnect from 172.67.8.90  port 2222:22 Too many authentication failureson client1:

Last edited by sag2662; 01-20-2023 at 04:07 AM.
 
Old 01-20-2023, 04:05 AM   #15
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
Quote:
Originally Posted by sag2662 View Post
on client1:
Code:
PAM: Authentication failure for illegal user test from "serverip"
Failed:/keyboard-interactive/pam for invalid user test from "serverip" port 54264 ssh2
Disconnecting invalid user test port 54264:Too many authentication failures
Thanks. That seems to narrow it down to "client1". Does the account "test" exist on that system? What are the full configuration settings there?

Code:
/usr/sbin/sshd -T -C user=test | sort
How have you set PAM there on "client1" ?
 
  


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
[SOLVED] raspbian: how to log in via ssh through wlan? (dont work; but ssh via LAN works) floppy_stuttgart Debian 8 03-24-2014 01:42 PM
system-config-packages doesnot work in RHEL 4 tuxfood Red Hat 0 12-13-2005 12:19 AM
Sound doesnot work anshulkothari Slackware - Installation 1 02-01-2004 06:46 PM
modem ADSL from sapo (Portugal) doesnot work in Suse9.0 lepton Linux - Distributions 0 11-16-2003 12:54 PM
RHN9 - Gnome crash, KDE doesnot work vijlovely Linux - Newbie 2 07-13-2003 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:18 PM.

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