LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-08-2019, 10:26 AM   #76
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937

File permissions might be an issue. Verify those are correct and look at the debug information using -v option using the command line as posted above using the correct private key file name.
 
Old 02-08-2019, 03:41 PM   #77
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 523

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk
It appears that you created the workid keys on the work computer and id keys on the home computer which means the config file IdentityFile keys are backwards.
got it! i saw it now. I managed to change the box B/config and I will change the box A/config tomorrow (i'm home now).

however, should i not be able to connect from B (home) to A (work) now?

when I run "ssh -v work" i get:
Code:
bash-5.0$ ssh -v work
debug1: Reading configuration data /home/box_B_user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to box.B.pub.ip [box.B.pub.ip] port 22.
debug1: connect to address box.B.pub.ip port 22: Connection timed out
ssh: connect to host box.B.pub.ip port 22: Connection timed out
 
Old 02-08-2019, 04:02 PM   #78
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 523

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
File permissions might be an issue.
by the way, ~/.ssh (and all it's files) belongs to user and groups users
 
Old 02-08-2019, 04:13 PM   #79
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Quote:
connect to address box.B.pub.ip port 22: Connection timed out
The router/gateway isn't configured correctly i.e. not forwarding port 22 to the correct IP address or ssh isn't running or a firewall is running that blocks ssh port.
 
Old 02-08-2019, 04:48 PM   #80
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 523

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
The router/gateway isn't configured correctly i.e. not forwarding port 22 to the correct IP address or ssh isn't running or a firewall is running that blocks ssh port.
ssh is running on both pcs and I don't think there is any firewall blocking ssh port (i tested it on both pcs via https://www.yougetsignal.com/tools/open-ports/

Since i have never done this before, the router settings may be wrong. I set:
eternal start port 22 to end port 22 | internal IP Address 192.168.xxx.xxx | internal start port 22 to end port 22 | protocol both tcp and udp
 
Old 02-08-2019, 04:56 PM   #81
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
How is your work computer IP address network configured? Static or DHCP address reservation?
 
Old 02-08-2019, 05:14 PM   #82
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 523

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
How is your work computer IP address network configured? Static or DHCP address reservation?
DHCP
 
Old 02-08-2019, 05:16 PM   #83
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
With an address reservation? If not is there a chance its IP address changed?
 
Old 02-08-2019, 05:22 PM   #84
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 523

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
With an address reservation? If not is there a chance its IP address changed?
ouch! i forgot that a few days ago i was left with no internet signal for 24hrs from my ISP due to their own tech issue. I didnt check it again once the we were reconnected and that may well be the case.
Another check to do tmrw.
Thanks for now and wish you all a happy wkend.
 
Old 02-09-2019, 04:21 AM   #85
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 523

Original Poster
Rep: Reputation: Disabled
wow!
as soon as i arrived at work today, I checked the public dynamic ip address and hadn't changed; so, i corrected the "config" file with the right "IdentityFile" and voila! I connected to my home desktop, box B.
I hope that the same magic happens when i go back home and try to connect backwards.

It has been a roller-coaster of learning and hands-on practice.
Thanks everyone

p.s.: i will mark the thread as Solved shortly (in case something goes unexpectedly on box B
 
Old 02-09-2019, 04:49 AM   #86
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Make sure your work computer Lan address is still the same as what is configured in the router.
 
Old 02-09-2019, 02:08 PM   #87
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 523

Original Poster
Rep: Reputation: Disabled
From post 77 i have not touched my home computer, box B.
Went to work this morning (didnt even switch on my desktop), happily connected all day from A to B flawlessly; passed a few files and made sure all routers settings were correct (both my internal and external IP still the same, port 22 forwarded on my internal ip, etc.) Just before leaving work, i checked that the id_key.pub (from id_rsa, created on the client, box B, home desktop) was correct and it was.
Came back home, "ssh work"
Code:
bash-5.0$ ssh work
box_B_user@22.33.xxx.000: Permission denied (publickey,keyboard-interactive).
bash-5.0$
Overnight, from "connection-timed-out" attempt, to not-liking-the-key again, i guess.
 
Old 02-09-2019, 03:31 PM   #88
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Maybe. Use the -v option and check the debug messages.
 
Old 02-09-2019, 03:58 PM   #89
however
Member
 
Registered: Jan 2019
Distribution: slackware current
Posts: 523

Original Poster
Rep: Reputation: Disabled
Code:
bash-5.0$ ssh -v work
OpenSSH_7.9p1, OpenSSL 1.1.1a  20 Nov 2018                                                                                                                            
debug1: Reading configuration data /home/home_user/.ssh/config                                                                                                        
debug1: /home/home_user/.ssh/config line 8: Applying options for work                                                                                                 
debug1: Reading configuration data /etc/ssh/ssh_config                                                                                                                
debug1: Connecting to xxx.71.000.111 [xxx.71.000.111] port 22.                                                                                                          
debug1: Connection established.                                                                                                                                       
debug1: identity file /home/home_user/.ssh/id_rsa type 0                                                                                                              
debug1: identity file /home/home_user/.ssh/id_rsa-cert type -1                                                                                                        
debug1: Local version string SSH-2.0-OpenSSH_7.9                                                                                                                      
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.3                                                                                              
debug1: match: OpenSSH_6.3 pat OpenSSH* compat 0x04000000                                                                                                             
debug1: Authenticating to xxx.71.000.111:22 as 'work_user'                                                                                                             
debug1: SSH2_MSG_KEXINIT sent                                                                                                                                         
debug1: SSH2_MSG_KEXINIT received                                                                                                                                     
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes128-ctr MAC: umac-64-etm@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-64-etm@openssh.com compression: none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:tU0PVzwWbBnpodooYh/OXf/igS4seMV7syAtjVBAB5Y
debug1: Host 'xxx.71.000.111' is known and matches the ECDSA host key.
debug1: Found key in /home/home_user/.ssh/known_hosts:4
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: Will attempt key: /home/home_user/.ssh/id_rsa RSA SHA256:DApfgwoqazxswedcoWr5G5USJol73ds6ab1YZMjUdtLYclERxhfg explicit
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /home/home_user/.ssh/id_rsa RSA SHA256:DApfgwoqazxswedcoWr5G5USJol73ds6ab1YZMjUdtLYclERxhfg explicit
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: No more authentication methods to try.
work_user@xxx.71.000.111: Permission denied (publickey,keyboard-interactive).
bash-5.0$
 
Old 02-09-2019, 10:54 PM   #90
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
The SSH client is finding its configuration settings. It connects to the remote machine, but the key you point to (id_rsa) from the client's configuration (on line 4 of the file) does not correspond to the public key in the authorized_keys file on the remote machine.

Either point to the right private key or else upload the right public key.
 
  


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
3 Ubuntu boxes with Samba - One finds all XP shares - Two UltraSparc64 boxes do not mwx Linux - Server 1 01-28-2009 06:03 AM
connecting two slackware linux boxes with an ethernet cable riodeuno Linux - Networking 3 12-17-2008 11:56 PM
connecting two linux boxes together jeffbk Linux - Networking 2 05-08-2007 12:12 PM
Connecting two linux boxes via cross cable ElPuello Linux - Networking 4 11-10-2004 10:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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