Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH in linux terminal "no matching key exchange method found" #276

Open
patrickboy555 opened this issue Mar 1, 2023 · 31 comments
Open

SSH in linux terminal "no matching key exchange method found" #276

patrickboy555 opened this issue Mar 1, 2023 · 31 comments

Comments

@patrickboy555
Copy link

Originally I tried to ssh into my DJA0231 through my linux terminal but had to switch over to a windows machine when I got this issue -

Unable to negotiate with 192.168.0.1 port 22: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,[email protected]

I did research on the issue and tried adding keys to cretin files in lunux and other such things but had no luck. Anyone else know the solution?

@seud0nym
Copy link
Contributor

seud0nym commented Mar 1, 2023

Create a file in the ~/.ssh directory called config and add the the following:

Host 192.168.0.1
    KexAlgorithms +diffie-hellman-group1-sha1
    PubkeyAcceptedAlgorithms +ssh-rsa
    HostkeyAlgorithms +ssh-rsa
StrictHostKeyChecking no

Save it and then it should work.

@patrickboy555
Copy link
Author

patrickboy555 commented Mar 1, 2023

Then I get

~/.ssh/config: line 3: Bad configuration option: pubkeyacceptedalgorithms
~/.ssh/config: terminating, 1 bad configuration options

@seud0nym
Copy link
Contributor

seud0nym commented Mar 1, 2023

A quick Google found this:

https://stackoverflow.com/questions/72540142/running-ssh-command-in-the-cmd-shows-me-bad-configuration-option-pubkeyaccepte

Either upgrade SSH or try PubkeyAcceptedKeyTypes instead of PubKeyAcceptedAlgorithms.

@patrickboy555
Copy link
Author

Thanks seud0nym that worked a treat I used

Host 192.168.0.1
    KexAlgorithms +diffie-hellman-group1-sha1
    PubkeyAcceptedKeyTypes +ssh-rsa
    HostkeyAlgorithms +ssh-rsa
StrictHostKeyChecking no

saves me jumping on to the offline windows machine

@patrickboy555
Copy link
Author

After swithcing everything off and coming back later I get the error
[email protected]: Permission denied (publickey).
err..
I did some reading but was unsuccessful.

@seud0nym
Copy link
Contributor

seud0nym commented Mar 1, 2023

Some people have seen this error after immediately acquiring root, and it goes away after a reboot.

Otherwise, did you make any changes? From the error, I would suspect that you have disabled password authentication and only enabled public key authentication.

If you have already installed tch-gui-unhide and can still access the web GUI, then you can re-configure SSH access to allow both password and certificate. Otherwise, it means having to re-acquire root. If you have already run any hardening tools like de-telstra that have disabled CWMP, then you will need to reset before attempting to regain root access.

@patrickboy555
Copy link
Author

patrickboy555 commented Mar 3, 2023

Hi seud0nym,
I was meaning to get back to this but got distracted.
I left it overnight and low and behold it worked the next day and has been working ever since, no idea why.

I tried to install tch-gui-unhide (I did sh de-telstra first) but something went wrong because the GUI looks like the attached image even though it said everything went well.
tch-gui-unhide bad2

I was stumbling through some of the order of things as I want to do all the VoIP Tweaks from the Hacking Technicolor Gateways guide because I will be using 2 voip services and landline phones but wasn't sure if I install tch-gui-unhide frist or after, I chose first.

Also I was a little confused as to how to download the extras for tch-gui-unhide I went to the page here but because I am a Noob I couldn't figure out how to download them all and add them to my USB. From what I read I would want to use most of them, if not all.

After I messed up the install I tried again to reinstall tch-gui-unhide with the 20.3.c.tar.gz on my USB but got the error
-ash: cd: can't cd to /tmp/run/mountd/sda1/: Too many levels of symbolic links
when I tried to cd to it.

@seud0nym
Copy link
Contributor

seud0nym commented Mar 3, 2023

something went wrong because the GUI looks like the attached image

Not always. First thing to try when things don't look correct is to clear your browser cache and refresh.

I want to do all the VoIP Tweaks from the Hacking Technicolor Gateways guide

First you need to work out what you want to do and then apply only the tweaks that are necessary. I would not recommend applying any of them until you find something that doesn't work. I personally have not applied any of them (except the ones that have been incorporated into de-telstra and/or tch-gui-unhide).

I will be using 2 voip services

As long as they from the same provider, you won't have any issues, and you don't need to apply any tweaks to make that work. Just set them up through tch-gui-unhide. However, if you are trying to use 2 different providers, then it won't work:
https://hack-technicolor.readthedocs.io/en/stable/Unlock/#unlocking-the-option-to-setup-a-second-sip-network

wasn't sure if I install tch-gui-unhide frist or after, I chose first.

First you run de-telstra, then you run tch-gui-unhide. After that, the majority of your configuration is done through the GUI.

I was a little confused as to how to download the extras for tch-gui-unhide

The easiest way to download and install the extras is with the -x option on tch-gui-unhide. For example, to install the adblock GUI extra, you would run:

./tch-gui-unhide -x adblock

You can specify the -x option multiple times to install the extras you require.

Make sure you have installed any pre-requisites before running tch-gui-unhide, though, otherwise they won't do anything.

Too many levels of symbolic links

This is a bug in de-telstra. The latest version fixes it. You can download the latest version with this command:

./de-telstra -U

and then re-run it with either no options or the options you wish to change. It will then fix the symbolic links issue.

@patrickboy555
Copy link
Author

patrickboy555 commented Mar 3, 2023

However, if you are trying to use 2 different providers, then it won't work

Well that is a big let down, I have home phone for my ISP and another sip provider for very cheap international calls. Is there no way to do this. :(
I guess I will have to stick with the old router.

Since I am in the middle of setting this up I will have to finish it.

clear your browser cache and refresh

This still kept me with the same screen, I also used more than one browser to check.

If I want to restart the install process from just before tch-gui-unhide and reinstall I guess I will have to just install vcnt-a_20.3.c.0432-MR21.1-RA.rbi again right? Oh no I cant access USB now. :(
This is a bug in de-telstra. The latest version fixes it.
strange I was using the latest tch-gui-unhide 2023.02.23.
./de-telstra -U
I am still offline with the modem, I was trying to do everything before I plug it in.

@seud0nym
Copy link
Contributor

seud0nym commented Mar 3, 2023

You can go online if you have run de-telstra (as long s you didn't use the -kc option) without fear of it auto-updating.

The too many symbolic links was found and fixed after the latest release, hence the need to update de-telstra individually.

You don't need to reflash the firmware. Just run tch-gui-unhide again.

@patrickboy555
Copy link
Author

I did run de-telstra but I also ran tch-gui-unhide so am afraid to plug her in.

You don't need to reflash the firmware. Just run tch-gui-unhide again.

Looks like I will have to chance it and go online to run tch-gui-unhide again as I cant get to the USB with out update de-telstra

@patrickboy555
Copy link
Author

patrickboy555 commented Mar 3, 2023

The command ./de-telstra -U dosent work for me now
-ash: ./de-telstra: not found
I can't access the USB anymore to extract the 20.3.c.tar.gz that is on it.
I think I am stuck.
Is there a way to update de-telstra from GUI?
or is there a way to extract 20.3.c.tar.gz on the PC?

@seud0nym
Copy link
Contributor

seud0nym commented Mar 3, 2023

The only issue with de-telstra is there was 1 character missing in the script in the release tar. It has still hardened your root access so that you can safely connect to the internet.

The following command will repair what de-telstra broke:

cp -p /rom/etc/config/mountd /etc/config/mountd

You will then be able to access the USB stick, update de-telstra, re-run it and then run tch-gui-unhide.

Without the fix that de-telstra should have applied (rather than breaking USB access), you may need to run the scripts prefixed with sh. e.g.

sh  ./de-telstra

Never extract the tar on a Windows PC and upload the individual scripts - nothing will work.

@patrickboy555
Copy link
Author

patrickboy555 commented Mar 3, 2023

cp -p /rom/etc/config/mountd /etc/config/mountd
This worked great, I was able to cd to USB, I put modem online and updated with -
sh de-telstra -U
This worked.
I re-ran de-telstra and tch-gui-unhide
sh de-telstra
sh tch-gui-unhide
both seemed to work.
but the GUI still looks the same as above, yes I restarted the modem and cleared browser cache.


What am I doing wrong?

@seud0nym
Copy link
Contributor

seud0nym commented Mar 3, 2023

Firefox, so open the menu (3 horizontal bars on top right), click on Settings, then "Privacy & Search" on the left, scroll down a bit and click the "Clear Data" button on the right. Untick "Cookies and Site Data" (i.e. just leave "Cached Web Content" ticked) and click on Clear.

Close Firefox, re-open and navigate to 192.168.0.1.

If that doesn't work, I have no idea. You will have to re-run tch-gui-unhide and post the output.

@patrickboy555
Copy link
Author

patrickboy555 commented Mar 3, 2023

Here it is in brave browser-
brave
It says it's working, but I expected the GUI to look like this without the telstra junk-

@patrickboy555
Copy link
Author

patrickboy555 commented Mar 3, 2023

I looked back at the Guide I followed from Hacking Technicolor Gateways and I followed steps for Hardening Gained Access and Unlock Web GUI Tiles before I added tch-gui-unhide because this is the order it is in on the guide, maybe this messed thing up as tch-gui-unhide does its own hardening.

@seud0nym
Copy link
Contributor

seud0nym commented Mar 3, 2023

You didn't need to do either of those steps, but they don't mess anything up.

de-telstra does all that hardening and much more, but it wouldn't cause a problem - running de-telstra after doing those steps would just apply additional hardening.

Same with tch-gui-unhide - it does those changes and much, much more. It will actually undo those changes and redo them, because it needs a stable, known base to apply its changes.

It looks that way because you haven't applied a theme. The default theme is the Telstra theme, which is why you are seeing the Telstra branding. The screen shot you posted was my DJA0231, using the monochrome theme. You can change the theme once you have logged in, or you can change it by re-running tch-gui-unhide with the appropriate options.

If you didn't add the -sa option when you ran tch-gui-unhide, then when you log in you will go to the basic screen as usual. That screen shot is the advanced screen. The -sa option makes the advanced screen the default.

@patrickboy555
Copy link
Author

Yes I thought this was the case and did log in to look for themes but could not find it, I guess I did not look long enough after you explained it I went inside Management and there it was hiding. I think seeing all the telstra brand made me think it wasn't working.

@patrickboy555
Copy link
Author

patrickboy555 commented Mar 3, 2023

It is a real pity that the second sip provider doesn't work on the device, it means I can't use it for my main router. But I did read that it can be used as a wifi extender so maybe I will look into that or sell it on. Do you think it will ever be fixed?

Do you have any recommendations for a good retail modem/router with all the features of this one (vdsl/adsl, wifi, phone line input port) I used to have Tp-link archer vr600v but the firmware was not the best and no OpenWRT. I think the latest version is vr2100v. It seems hard to find a all in one device with phone line input ports.
Maybe you can recommend some others that wont break the bank budget.

@seud0nym
Copy link
Contributor

seud0nym commented Mar 3, 2023

Do you think it will ever be fixed?

No. Telstra won't fix something they are never going to use.

It doesn't actually say it won't work, it just says that it might be unpredictable. You could just try it, and see what happens.

You could also follow the advice in the warning and use asterisk. You could even install asterisk on the DJA0231, but I don't know how much memory it takes. A DJA0230 has more RAM, and also has 2 phone ports. Using asterisk is outside of my experience, though.

No idea about other modems with similar capabilities. Sorry.

@patrickboy555
Copy link
Author

patrickboy555 commented Mar 4, 2023

Anyway thanks for all your help, I will do more reading and try to get the second sip on there. I was also looking for call forwarding, but need to roam around in the GUI to find it.

@patrickboy555
Copy link
Author

I looked for call forwarding but I can't see an option in Telephony did I miss it somewhere?
According to this (under voip) it should support call forwarding.
I did find a video on astrix here but my sip that I use for international calls only needs to go out so it may work without it as it said in the guide just the listener has problems

The SIP message listener for the second network will end up being used for both SIP networks.

I am assuming that is for incoming calls (which I don't need)

@seud0nym
Copy link
Contributor

seud0nym commented Mar 4, 2023

I looked for call forwarding but I can't see an option in Telephony did I miss it somewhere?

That page you referenced would mean you can do call forwarding when the service is provided by Telstra, but I have not seen any specific configuration that would allow you to configure it on the modem. Again, you really need a more fully featured PBX like asterisk for that.

so it may work without it as it said in the guide just the listener has problems

Sounds possible.

@patrickboy555
Copy link
Author

I spent some time trying to get the second sip working but it is a no go. The voip part of this device is not good for more than one provider, even when one is just outgoing calls. No call forwarding either.

I wanted to try out asterisk but because I am not experienced with this stuff I can't even install it on the DJA0231. I know that using asterisk is outside of your experience but can you help me install it on the DJA0231? then I can play around with using online guides.

I was able to put asterisk-20-current.tar.gz onto a USB and SSH into the DJA0231, I extracted it and went to the correct dir but was unable to compile with ./configure
got no acceptable C compiler found in $PATH as I say I am not so experienced.

Do you think that FreePBX, trixbox or any of the other web GUI's would work on the DJA0231?

@seud0nym
Copy link
Contributor

You can't use anything the requires compilation, because as you found, there is no compiler. With this and other OpenWrt implementations, you install packages from a repository that is suitable for your device.

You can use this repository: https://repository.macoers.com/homeware/18/brcm63xx-tch/VANTW/

There is a README.md that you need to have a look to show you how to configure the package manager. Then you use the opkg command to list/install/remove/etc. packages.

@patrickboy555
Copy link
Author

@seud0nym thank you very much I would not have been able to find this on my own. I did search for "installing asterisk on Technicolor devices" and other similar things but didn't have any luck, I guess you have to know where to look. I will try it out when I get some time. :)

@patrickboy555
Copy link
Author

I followed the instructions in the README.md I did make a mistake in that one of the commands was pasted as a new line, so I redid the commands again. Once finished I ran opkg list and got the error shown below (image) it says skipped but should I fix this?

errors

I am still not sure how to install Asterisk, what the command is. I seen on the website in the repository file list that under the telephony folder there are lots of different Asterisk .ipk files. What would be the command to install the latest Asterisk from the repository then?

@seud0nym
Copy link
Contributor

That error indicates that you have some duplicated some lines in your customfeeds.conf file. Did you also run de-telstra with the -o option? If you did, that would have already configured the repository for you, so you didn't need to actually do the configuration step. I should have asked.

Anyway, I have no idea which asterisk packages you need. I assume there is a base package, then add-ons that allow you to configure the aspects that you require for your needs. You can google for help with asterisk on openwrt, but avoid anything that talks about LuCI - that is not available on these devices.

You would best to open a new asterisk question if you can't work it out.

@patrickboy555
Copy link
Author

Great I searched and found this link which looks promising. I will go through the guide later. Can you tell me what version of openwrt this router has or better yet the command to find that information?
Yes I did run de-telstra with the -o option because I was intending to install extras from tch-gui-unhide. I did not know it was the same repository.
Should I fix the customfeeds.conf file?

@seud0nym
Copy link
Contributor

Can you tell me what version of openwrt this router has or better yet the command to find that information?

Technicolor forked their own version of OpenWrt. Prior to the 20 version firmwares, it seems to have been based on 15.05. Latest firmware is an unknown OpenWrt snapshot. You can see it here:

cat /etc/openwrt_release

Should I fix the customfeeds.conf file?

Yes, if you want to get rid of those error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants