Connecting to DSL-2740B via ssh

Back again struggling with a stupid issue related to dsl modem.

I was trying to connect to the modem via ssh, but no way to get i work, with ssh i got this log:

debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa
debug2: kex_parse_kexinit: 3des-cbc
debug2: kex_parse_kexinit: 3des-cbc
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: setup hmac-md5
debug1: kex: server->client 3des-cbc hmac-md5 none
debug2: mac_setup: setup hmac-md5
debug1: kex: client->server 3des-cbc hmac-md5 none
debug2: bits set: 539/1024
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY

Server and client don’t share comunication informatin the right way, so the server decides to close the comunicating (Something that happens even with peoples in real life). So the client needs to force some parameters to set up the propre way to comunicate, in fact chipper and algorithm:

The command line becomes this:

ssh -o Ciphers=3des-cbc -o HostKeyAlgorithms=ssh-rsa,ssh-dss 192.168.1.1 -vv -l admin

To remember this configurations i use the .ssh/config

Host router
HostName 192.168.1.1
User admin
Ciphers 3des-cbc
HostKeyAlgorithms ssh-rsa,ssh-dss

 

Passwordless SSH – Mini howto

Recently I had to administer a new site on which I was not allowed to change th password for policy reasons and the password was very complex, something like this: Un&U2p3rC@s0 (not real password 😉 )

Each time I had to log on I lost a lot of time, so for the first time I decided to generate RSA public/private keys to log on a system. For many who are used to this it’s very simple and for me up to now it’s very easy too.

Basically you have to generate a key pair, a public key and a private key. The question was for me who holds the public and who the private one. It very simple the user holds the private key, whinch is private for this reason and the server holds the public one. The next big question for me was, on which machine should I generate the key pair? The answer is very simple after the generation of the key pair you have to copy one to the aothe machine so the one you can pass on internet is the public one.

After I found the answer to this questions thenext step was very easy:

1) Log on to your client machine

2) type ssh-keygen -t rsa -p ” (You can play with these parameters in many ways)

3) scp the public key to the remote ssh server (scp .ssh/id_rsa.pub remoteuser@sshserver:.ssh/authorized_keys

4) The copied file should have 0600 permissions, so one more logon to the server using the typed password and chown 0600 .ssh/authorized_keys

Bingo!!!. Now you are able to logon without typing the password.

Just some notes:

Your server administrator should allow authorized_keys in user home directories. Before following this steps do some check.

WP to LinkedIn Auto Publish Powered By : XYZScripts.com