mickey1940
Posts: 10
Joined: Sun Jan 03, 2016 9:29 pm

Networking and SSH problems

Sat Jun 22, 2019 11:55 am

I have a Fedora- Raspi setup to run Rak-Gateway
Router 192.168.0.1
Fedora 192.168,0,103
Raspi 192.168.0.100
POE (Power Over Ethernet) to power Raspi-Rak gateway.
I'm not well up to date on how to make changes in a Debian computer so please take that into consideration.
I'm mainly a RPM Guy.

On Networking: I have setup in Router, DHCP/Address Reservations, both the Raspi-3+ and Fedora-28.
But I cannot get the raspi to showup in Router/DHCP/Client List
So I cannot get the Raspi to get onto the internet.
Raspi can Ping Router-192.168.0.1 and Fedora 192.168.0.103, but can't get onto Internet.

SSH Problem: I can;t get to that until I get the Networking problem fixed.

[root@mickey mickey]# ssh pi@192.168.0.100 ( Command run from Fedora)
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:MLqV6aSf8hJzYninnEDNesULP76++6VAlYWG9qSTkwM.
Please contact your system administrator.

Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:2
ECDSA host key for 192.168.0.100 has changed and you have requested strict checking.
Host key verification failed.

(Run from Raspi)
/root/.ssh/known_hosts and host2 (No such file or directory) in Raspi.)
Known _hosts- is that setting in the Raspi ?
What Host would that be.
From what I can see is, SSH is not setting up on Raspi.

I have been working in the Router so I think the first half of this message has to do with that.

If I type hostname in raspi it comes back with "rak-gateway" without quotes

What is command in Debian for Change Directory , (cd) in Fedora. In Raspi it says sudo cd command not found. (BOY!!!, This is getting Crazy).

User avatar
rpdom
Posts: 15005
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Networking and SSH problems

Sat Jun 22, 2019 12:03 pm

The ~/.ssh/known_hosts file that is causing the problem is on your fedora box. You need to remove line 2 from that file.

mickey1940
Posts: 10
Joined: Sun Jan 03, 2016 9:29 pm

Re: Networking and SSH problems

Sat Jun 22, 2019 1:58 pm

This is the file you are talking about.
When I open the file , the top line was 192.168.0.102 An I changed it to 192.168.0.3 is this right ?
Fedora is 192.168.0.103
Raspi is 192.168.0.100
Router is 192.168.0.1

192.168.0.103 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBII0eiHDEkdbpW9wqreGAt83rTwJjKxfV4O+ZwkdsW1F4xcSkDcjqGf0qD+oO7tZfMFYghLJRMezMXgzDg4Ohrg=
192.168.0.100 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBII0eiHDEkdbpW9wqreGAt83rTwJjKxfV4O+ZwkdsW1F4xcSkDcjqGf0qD+oO7tZfMFYghLJRMezMXgzDg4Ohrg=

mickey1940
Posts: 10
Joined: Sun Jan 03, 2016 9:29 pm

Re: Networking and SSH problems

Sat Jun 22, 2019 2:26 pm

I deleted everything in /root/.ssh/known_hosts and ran ssh pi@192.168.0.100 and now I'm connected to ssh Raspi.
Thanks very much guys.

NOW!!! , if you can help me get Raspi connected to the Internet.
See my previous message on Network Problems


I have a Fedora- Raspi setup to run Rak-Gateway
Router 192.168.0.1
Fedora 192.168,0,103
Raspi 192.168.0.100
POE (Power Over Ethernet) to power Raspi-Rak gateway.
I'm not well up to date on how to make changes in a Debian computer so please take that into consideration.
I'm mainly a RPM Guy.

On Networking: I have setup in Router, DHCP/Address Reservations, both the Raspi-3+ and Fedora-28.
But I cannot get the raspi to showup in Router/DHCP/Client List
So I cannot get the Raspi to get onto the internet.
Raspi can Ping Router-192.168.0.1 and Fedora 192.168.0.103, but can't Ping onto the Internet.

ping: Yahoo.com: Temporary failure in name resolution
The Router does not have any setting in the DHCP/ Clients-Lists for the Raspi. It does show the Fedora 192.168.0.103 in Clients-lists.
Last edited by mickey1940 on Sat Jun 22, 2019 3:02 pm, edited 4 times in total.

mickey1940
Posts: 10
Joined: Sun Jan 03, 2016 9:29 pm

Re: Networking and SSH problems

Sat Jun 22, 2019 2:46 pm

The command cd , is it not a good command in Debian ?
everytime I use the command sudo cd /root , It comes back with sudo: cd: command not found
What is the problem here ?

tpyo kingg
Posts: 589
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: Networking and SSH problems

Sat Jun 22, 2019 3:18 pm

(cd is built into the shell and not affected by sudo, also it only changes the working directory. So you'll need to point sudo at a specific utility such as ls or cat. I'm not sure how it is related to the task at hand however. You should be able to, and should in general, connect to the Raspberry Pi without sudo. For more about cd, see "man bash" and scroll down to the section with the heading "SHELL BUILTIN COMMANDS". That's a monster of a manual page but worth navigating through to the good parts.)

The ~/.ssh/lknown_hosts file is relevant on the machine you are connecting from. It contains a register of the server keys from the machines you have already connected to at least once in the past. Whenever you try to connect again, there is a verification process which makes use of the server's keys to ensure that you are still connecting to the same machine you have connected to before.

If the old server keys held in known_hosts don't match the machine you are currently connecting to, then you need to make sure you really are connecting to the right host. The SSH server's keys are what the client is complaining about. There are two common reasons for having a bad key in known_hosts. One is that you reinstalled the Raspberry Pi and did not backup + restore the old keys in the process. The other is that your router is pointing you at a different computer. If it is the former, then just erase the old key from known_hosts and move on. If it is the latter, there is some more work ahead.

klricks
Posts: 6549
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Networking and SSH problems

Sat Jun 22, 2019 3:30 pm

mickey1940 wrote:
Sat Jun 22, 2019 2:46 pm
The command cd , is it not a good command in Debian ?
everytime I use the command sudo cd /root , It comes back with sudo: cd: command not found
What is the problem here ?
sudo and cd can't be used together.

To get to /root you must first create a root password if you haven't already.

sudo passwd root


Then type su and the root password when prompted.
Edit: Use sudo su instead.

Code: Select all

sudo su
Then

Code: Select all

cd /root
Last edited by klricks on Sat Jun 22, 2019 7:42 pm, edited 1 time in total.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

mickey1940
Posts: 10
Joined: Sun Jan 03, 2016 9:29 pm

Re: Networking and SSH problems

Sat Jun 22, 2019 3:57 pm

I already have setup a new password for the Raspi but I did not change Username pi .

MrEngman
Posts: 3844
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Networking and SSH problems

Sat Jun 22, 2019 4:14 pm

No need to create a root password.

When logged into my Pi with user pi to access /root directory all I have to do is

Code: Select all

sudo su
cd /root
And when done doing whatever you need to exit from su using command

Code: Select all

exit

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

klricks
Posts: 6549
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Networking and SSH problems

Sat Jun 22, 2019 7:36 pm

mickey1940 wrote:
Sat Jun 22, 2019 3:57 pm
I already have setup a new password for the Raspi but I did not change Username pi .
The password for user pi and the root password are 2 different things.
As Mr Engman said there is no need to create the root password. Just use sudo su.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

mickey1940
Posts: 10
Joined: Sun Jan 03, 2016 9:29 pm

Re: Networking and SSH problems

Sat Jun 22, 2019 7:47 pm

/etc/resolv.conf is locked into namserver 127.0.0.1 and I need it to say nameserver 192.168.0.1 (Router) so I can get Pi onto Internet.

/sbin/resolvconf is what is changing /etc/resolv.conf that is putting nameserver 127.0.0.1 in.

How can I stop /sbin/resolconf from changing nameserver in /etc/resolv.conf ?

Why do I need /etc/resolv.conf change to nameserver 127.0.0.1 ?

Return to “General discussion”