LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-23-2023, 10:04 AM   #1
rshepard
Member
 
Registered: Oct 2007
Location: Troutdale, Oregon
Distribution: Slackware
Posts: 435

Rep: Reputation: 28
ssh will not connect to other LAN host


Running 15.0 on a Toshiba Lenovo T430 (hostname: caddis) and trying to ssh to the desktop server/workstation (hostname: salmo; running 14.2). I am having difficulty learning why they won't communicate. I use a high-number port (redacted here); here is the output of running the command ssh -vv salmo after providing my salmo password:

debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve: disabling
debug2: resolving "salmo" port nnnnn
ssh: Could not resolve hostname salmo: Temporary failure in name resolution.

In salmo's /etc/hosts there is:
192.168.55.1 salmo, salmo.appl-ecosys.com

Any idea what I've done wrong?

TIA,

Rich
 
Old 04-23-2023, 10:16 AM   #2
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 590

Rep: Reputation: Disabled
I assume you mixed up your information when sharing with us. That entry for /etc/hosts should be on caddis, not just on salmo.
Also, you cannot have provided your salmo password unless you already had a ssh connection between the two hosts. So either you are making this up or you are really confused.
Furthermore, get rid of that comma behind "salmo", it has no place in a hosts file. See "man hosts".
 
1 members found this post helpful.
Old 04-23-2023, 07:41 PM   #3
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,453
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Quote:
Originally Posted by rshepard View Post
ssh: Could not resolve hostname salmo: Temporary failure in name resolution.
If you want to use names instead of IP addresses, you need to either have a DNS server within your LAN or add the names and corresponding IP addresses to /etc/hosts on whichever client machine you're using.

eg: On your laptop, you need to put this into /etc/hosts:
Code:
192.168.55.1 salmo.appl-ecosys.com salmo
For more information:
Code:
$ man 5 hosts
 
1 members found this post helpful.
Old 04-25-2023, 02:07 PM   #4
rshepard
Member
 
Registered: Oct 2007
Location: Troutdale, Oregon
Distribution: Slackware
Posts: 435

Original Poster
Rep: Reputation: 28
The /etc/hosts file is the same on both hosts.

Both hosts can ping each other.

From salmo I can ssh into caddis and the shell prompt shows 'caddis' as the host.

When I try to ssh from caddis to salmo, after entering my password the shell prompt shows 'caddis' as the host, not 'salmo.' And `ls` shows the contents of ~/ on caddis.
 
Old 04-25-2023, 03:58 PM   #5
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 590

Rep: Reputation: Disabled
Quote:
Originally Posted by rshepard View Post
When I try to ssh from caddis to salmo, after entering my password the shell prompt shows 'caddis' as the host, not 'salmo.' And `ls` shows the contents of ~/ on caddis.
Did you fix your /etc/hosts entries, removing the comma that does not belong? I guess not.
You get a password prompt which means the two computers talk to each other, but in the end ssh fails to log you in because of that DNS resolving error. Do you have an old entry for salmo (with the wrong IP address) in your ~/.ssh/config file perhaps?
 
Old 04-25-2023, 04:04 PM   #6
emidevices
Member
 
Registered: May 2016
Location: In a village of La Mancha
Distribution: Slackware, Devuan, NetBSD
Posts: 62

Rep: Reputation: Disabled
Quote:
The /etc/hosts file is the same on both hosts.
Could it be that you are connecting from caddis to the caddis itself?
 
Old 04-26-2023, 12:30 AM   #7
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,453
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Quote:
Originally Posted by rshepard View Post
The /etc/hosts file is the same on both hosts.
It doesn't need to be.
Quote:
Originally Posted by rshepard View Post
Both hosts can ping each other.
Using IP addresses, or names?
Quote:
Originally Posted by rshepard View Post
When I try to ssh from caddis to salmo, after entering my password the shell prompt shows 'caddis' as the host, not 'salmo.'
So the process is failing.

Have you taken the suggestion above and removed the comma from your /etc/hosts file?
 
Old 04-26-2023, 12:43 AM   #8
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by rshepard View Post
The /etc/hosts file is the same on both hosts.

Both hosts can ping each other.

From salmo I can ssh into caddis and the shell prompt shows 'caddis' as the host.

When I try to ssh from caddis to salmo, after entering my password the shell prompt shows 'caddis' as the host, not 'salmo.' And `ls` shows the contents of ~/ on caddis.
Please show us the output from the following commands on host caddis:

Code:
fgrep hosts /etc/nsswitch.conf
fgrep salmo /etc/hosts
ping -c 1 salmo
/sbin/ifconfig | grep -B1 192
traceroute salmo
ssh -v salmo
regards Henrik
 
  


Reply

Tags
ssh access



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
ssh: connect to host 192.168.0.14 port 22: No route to host xo)mora CentOS 5 01-28-2019 12:58 PM
[SOLVED] SSH no route to host error. can ssh outside lan, but not to clients on lan... jmd9qs Linux - Networking 3 01-21-2012 10:28 AM
Can ssh into host on lan using WLAN address, but not through LAN address gurkakrieg Slackware 4 01-05-2010 07:19 AM
ssh: connect to host .....No route to host soumyacs Linux - Newbie 5 10-27-2009 10:03 AM
ssh + pop3 with kmail: Could not connect to host localhost, but ok without ssh Emmanuel_uk Linux - Networking 0 07-20-2006 04:56 PM

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

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