Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
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.
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
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.
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
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.
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$
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.