What's new

connect to router via ssh

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

RCV

New Around Here
Hey,
i am trying to connect to my router RT-AC66U (firmware 380.68_2) via ssh. But something goes wrong. My router has IP address: 192.168.1.1, my computer 192.168.1.3

If i use command ssh -vvv username@192.168.1.1

OpenSSH_7.4p1 Ubuntu-10, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /home/RCV/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "192.168.1.1" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.​

Then it hangs out for a minute or so and after this i get:

debug1: connect to address 192.168.1.1 port 22: Connection timed out
ssh: connect to host 192.168.1.1 port 22: Connection timed out​

In router, I do not see any information in log messages.

Parameters for ssh server on router are following:
Enable SSH Lan Only
Allow SSH Port Forwarding Yes
SSH service port 22
Allow SSH password login Yes
Enable SSH Brute Force Protection Yes
SSH Authentication key

I tried all combinations of these parameters. Nothing works.

It is also worth to note that i can ping the router

PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.​
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.55 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=18.2 ms
^C
--- 192.168.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.555/9.909/18.263/8.354 ms

However i cannot use traceroute:
traceroute 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1), 30 hops max, 60 byte packets
1 * * *
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
8 * * *
9 * * *
10 * * *

I also tried nmap -sV 192.168.1.1.
I get:
PORT STATE SERVICE VERSION
22/tcp filtered ssh
53/tcp open domain dnsmasq 2.76
80/tcp open http httpd/2.0
139/tcp filtered netbios-ssn
443/tcp open ssl/http lighttpd 1.4.39
445/tcp filtered microsoft-ds
515/tcp open printer?
8081/tcp open http lighttpd 1.4.39
8082/tcp open http lighttpd 1.4.39
8200/tcp open upnp MiniDLNA 1.2.0 (OS: 378.xx; DLNADOC 1.50; UPnP 1.0)
9100/tcp open jetdirect?
9998/tcp open tcpwrapped​

.....


Could you help me to connect my computer to the router via ssh?
 
So do you get as far as it asking for the router's password after entering the username?

I'd try again but using Putty or XShell.

(as you're sticking to port 22, I'd change Allow SSH Port Forwarding to No. shouldn't make a difference though, but try it.)
 
I am not positive but you may need to try username:password@192.168.1.1

Sent from my Pixel using Tapatalk
 
I am not positive but you may need to try username:password@192.168.1.1

Sent from my Pixel using Tapatalk

I thought this answer was a joke at first because the [colon]p came through as pink emoji with a tongue sticking out in my Chrome browser! Anyway, I believe the above answer is correct (minus the :p), you need [username]:[password]@[hostname or ip].
 
I thought this answer was a joke at first because the [colon]p came through as pink emoji with a tongue sticking out in my Chrome browser! Anyway, I believe the above answer is correct (minus the :p), you need [username]:[password]@[hostname or ip].
Or you know, use the CODE block...
 
I thought this answer was a joke at first because the [colon]p came through as pink emoji with a tongue sticking out in my Chrome browser! Anyway, I believe the above answer is correct (minus the :p), you need [username]:[password]@[hostname or ip].
Crikey! You are more switched on than I am: I reported it as "not helpful". I guess I can't see beyond my assword .



I didn't know you could enter [username]:[password]@[hostname or ip]. However, I still think it's worth trying something like Putty and entering the username and password in separate steps just in case it's stalling for some odd reason at one of those 2 credentials; it just might give a clue.
 
I am not positive but you may need to try username:password@192.168.1.1

Sent from my Pixel using Tapatalk

I tried to do this. It doesnot work too. I tried to connect without password with the key. It doesnot work too.
 
I tried to do this. It doesnot work too. I tried to connect without password with the key. It doesnot work too.

I'd try again but using Putty or XShell.

Back to the original issue -- I have the same thought as @martinr: Have you tried to ssh into the router from a different device to isolate the failure? Is it a problem on the router side, or is it an Ubuntu ssh issue? Can you ssh into another device on your network from your Ubuntu box? If it's an Ubuntu problem you may want to pursue an answer on one of their forums.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top