LinuxQuestions.org
Help answer threads with 0 replies.
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 04-11-2018, 08:04 PM   #16
Coop_012
Member
 
Registered: Jan 2018
Location: US
Distribution: Debian 9.6 Stretch
Posts: 97

Original Poster
Rep: Reputation: Disabled

i have logged into my laptop on my laptop and desktop on my desktop, when i try to log on to ssh coop@10.x.x.xx i get this
Code:
 ssh coop@10.0.0.24
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:ujTAuRTqhh0QTM9ADVw9/Lt0+EWJo6akPf77QqBEVyw.
Please contact your system administrator.
Add correct host key in /home/cooper/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/cooper/.ssh/known_hosts:1
  remove with:
  ssh-keygen -f "/home/cooper/.ssh/known_hosts" -R 10.0.0.24
ECDSA host key for 10.0.0.24 has changed and you have requested
 
Old 04-11-2018, 08:05 PM   #17
Coop_012
Member
 
Registered: Jan 2018
Location: US
Distribution: Debian 9.6 Stretch
Posts: 97

Original Poster
Rep: Reputation: Disabled
i have however succesfully ssh from my desktop to my laptop!
 
Old 04-11-2018, 08:09 PM   #18
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
As the warning states run the command.
ssh-keygen -f "/home/cooper/.ssh/known_hosts" -R 10.0.0.24

Let me know when you created the keys and tested the keys
 
Old 04-11-2018, 08:23 PM   #19
Coop_012
Member
 
Registered: Jan 2018
Location: US
Distribution: Debian 9.6 Stretch
Posts: 97

Original Poster
Rep: Reputation: Disabled
got it! i have ssh on my laptop to desktop and vice versa!!!! thank ya I couldn't have done that myself! btw how do you get updated so quickly that I made a post

Last edited by Coop_012; 04-11-2018 at 08:25 PM.
 
Old 04-11-2018, 08:28 PM   #20
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Quote:
Originally Posted by Coop_012 View Post
got it! i have ssh on my laptop to desktop and vice versa!!!! thank ya I couldn't have done that myself! btw how do you get updated so quickly that I made a post
Using keys?
 
Old 04-11-2018, 08:30 PM   #21
Coop_012
Member
 
Registered: Jan 2018
Location: US
Distribution: Debian 9.6 Stretch
Posts: 97

Original Poster
Rep: Reputation: Disabled
I did the keygen and passphrase thingy if that is what ya mean?

for ex I am on my laptop. I ssh into my desktop. within the desktop I keygen then saved it to my desktop set my passphrase and then had to logout twice

Last edited by Coop_012; 04-11-2018 at 08:31 PM.
 
Old 04-11-2018, 08:41 PM   #22
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Ok. Now go back and disable password authentication.

You should still be able to login.

To access the desktop from outside your network requires some additional steps.

You need to log into the router and add an address reservation for the desktop. You also need to configure the router to forward port 22 to the desktop IP address.

You should be able to login to the desktop using your public IP address. You can find your public IP address from the WAN setup page in your router or whatsmyipaddress.com or similar web site.

ssh user@public_IP_address.
 
Old 04-11-2018, 08:43 PM   #23
Coop_012
Member
 
Registered: Jan 2018
Location: US
Distribution: Debian 9.6 Stretch
Posts: 97

Original Poster
Rep: Reputation: Disabled
okay, say i want to add my phone, do i add a key or if im not really worried about it can i just let it be? cause when i went to use the keygen command it wanted to overwrite the file which i said no to. If I hit yes would it keep the old keys?
 
Old 04-11-2018, 08:51 PM   #24
Coop_012
Member
 
Registered: Jan 2018
Location: US
Distribution: Debian 9.6 Stretch
Posts: 97

Original Poster
Rep: Reputation: Disabled
by the way that video I was watching online, the guy was on /etc/ssh/sshd_config as opposed to /etc/ssh_config do I have to change the password authentication on that doc as well? cause when I turned it off, O restarted the service it was permission denied (publickey) so I turned it back on for the time being.
 
Old 04-11-2018, 09:19 PM   #25
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
sshd_config is the server file and ssh_config the client. No you do not need to change ssh_config.

Do you want to run a ssh server on your phone or log into your desktop? It depends on the phone and what application needs to be installed.
 
Old 04-11-2018, 09:23 PM   #26
Coop_012
Member
 
Registered: Jan 2018
Location: US
Distribution: Debian 9.6 Stretch
Posts: 97

Original Poster
Rep: Reputation: Disabled
I have the terminus app on my iPhone (don’t shoot) so I can log in and I have ssh into both devices. I just don’t have any keys set up and your help has been superb by the way
 
Old 04-11-2018, 09:31 PM   #27
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
I don't know. I am not familiar with the app but I think so.
 
Old 04-11-2018, 09:34 PM   #28
Coop_012
Member
 
Registered: Jan 2018
Location: US
Distribution: Debian 9.6 Stretch
Posts: 97

Original Poster
Rep: Reputation: Disabled
They also run a terminal emulator nothing real special though
 
Old 04-11-2018, 10:49 PM   #29
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by Coop_012 View Post
okay, say i want to add my phone, do i add a key or if im not really worried about it can i just let it be?
The best way is to add a key to the phone, but you can generate the key anywhere and then transfer the private half to the phone and the public half to the target machine.

It's usually considered a good idea have a unique key pair for each set of devices. So the phone should be using its own keys to connect to either the desktop or the laptop.

Quote:
Originally Posted by Coop_012 View Post
cause when i went to use the keygen command it wanted to overwrite the file which i said no to. If I hit yes would it keep the old keys?
You can use the -f option to name the key file someting unique. That way the old file won't get overwritten. Likewise you can add the -C option to add a note to help remember what the key is for.

Code:
cd ~/.ssh/

ssh-keygen -f dt_to_laptop  -C "connect to laptop from desktop" -t ed25519
ssh-keygen -f lt_to_desktop -C "connect to desktop from laptop" -t ed25519

ssh-keygen -f ph_to_laptop  -C "connect to laptop from phone"  -t rsa -b 4096
ssh-keygen -f ph_to_desktop -C "connect to desktop from phone" -t rsa -b 4096
Note that you can use "-t ed25519" instead of "-t rsa -b 4096" if you can handle modern keys, which would make keys using the Ed25519 algorithn. The phone might not handle those, so the above makes 4096-bit RSA for the phone just in case backward compatibility is needed. However, check with the documentation for Termius and see if it supports Ed25519 and use that instead if you can. It's not just a new algorithm, it's in a different category from RSA.

Then put the keys in place:

Code:
ssh-copy-id -i dt_to_laptop  me@laptop
ssh-copy-id -i lt_to_desktop me@desktop

ssh-copy-id -i ph_to_laptop  me@laptop
ssh-copy-id -i ph_to_desktop me@desktop
Then on each client you can see your key files in the directory ~/.ssh/ and on each "server" in the file ~/.ssh/authorized_keys You can use the file ~/.ssh/config in each of the client machines to make shortcuts. So on the laptop you'd have:

Code:
Host desktop
  Hostname 192.168.1.126
  IdentityFile ~/.ssh/lt_to_desktop
  User thecoop
  IdentitiesOnly yes
Then you'd only need to type "ssh desktop" on your laptop and it will connect. If you like that, do vice versa for the desktop's ssh_config file.

Somehow you will have to get "ph_to_laptop" and "ph_to_desktop" over to the phone. You write that you have an iPhone, the Termius app on the iphone has a lot fewer features than the Android version. It says "PuTTY" keys on the Apple page so you may have to convert the phone's keys before transferring them to the phone.
 
Old 04-12-2018, 06:16 AM   #30
Coop_012
Member
 
Registered: Jan 2018
Location: US
Distribution: Debian 9.6 Stretch
Posts: 97

Original Poster
Rep: Reputation: Disabled
Ah I see, thank you for the explanation Turbo!
 
  


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
unable to connect to any of the specified host exception is displaying while trying to connect to remote database nsoma26@gmail.com Linux - Newbie 4 03-08-2018 06:50 AM
ssh can not connect remote host crazy6 Linux - Newbie 2 03-04-2011 07:28 PM
telnet: Unable to connect to remote host: No route to host grob115 Linux - Networking 3 07-30-2010 10:18 AM
how 2 connect 2 remote host using SSH fhameed Linux - Networking 2 09-08-2004 08:42 PM
Best way to connect to a remote host? neilcpp Linux - Networking 1 09-01-2003 01:11 PM

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

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