What's new

Can connect to router via SSH in Terminal but not GUI, why and how to fix

  • 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!

northbear

Occasional Visitor
Looking to backup files via SSH to a USB hard drive and ran into some issues.

I can SSH into the machine with the "admin" user and the correct password via the terminal no problems.

Code:
___@_______:~$ ssh admin@192.168.1.1
admin@192.168.1.1's password:


ASUSWRT-Merlin RT-AC56U_3.0.0.4 Thu Dec 24 18:53:48 UTC 2015
admin@RT-AC56U-C3B0:/tmp/home/root# exit
Connection to 192.168.1.1 closed.

Log gives
Code:
Aug 20 11:32:21 dropbear[15382]: Child connection from 192.168.1.10:57170
Aug 20 11:32:24 dropbear[15382]: Password auth succeeded for 'admin' from 192.168.1.10:57170
Aug 20 11:32:33 dropbear[15382]: Exit (admin): Disconnect received

everything looks OK to me - I exit a couple seconds after I logged in

But when I try to connect via either deja dup back or via the "connect to server" in ubuntu it says connection failed. Looking at the log it looks like the program is immediately exiting for some reason?

Code:
Aug 20 11:26:09 dropbear[15055]: Child connection from 192.168.1.10:56916
Aug 20 11:26:28 dropbear[15055]: Password auth succeeded for 'admin' from 192.168.1.10:56916
Aug 20 11:26:28 dropbear[15055]: Exit (admin): Disconnect received

Here it exit immediately after logging in, why?

Did a bunch of searching and can't seem to figure this out. Any suggestions. Seems like I am missing something simple.


Tangential background (linked just FYI)
http://www.snbforums.com/threads/backup-desktop-files-to-hard-drive-on-router-best-method.34205/
 
To the best of my knowledge I was trying with SSH.
below are screenshots of "Connect to Server" and Deja Dup. On the pull-down I just selected the SSH. Unless it is doing something behind the scenes that I am unaware of?

Connect to Server
upload_2016-8-20_13-40-41.png


Deja Dup
upload_2016-8-20_13-41-42.png
 
Don't know Deja Dup.....but you have the storage location folder specified as '/' which is read only router memory. Shouldn't you be specifying the mount point of your USB storage?
 
From what I've read, Deja Dup is just a front end for duplicity and according to the link I posted it uses SFTP by default (but duplicity can be changed to use SSH/SCP). You'd have to see if there are any log messages on the client side.
 
From what I've read, Deja Dup is just a front end for duplicity and according to the link I posted it uses SFTP by default (but duplicity can be changed to use SSH/SCP). You'd have to see if there are any log messages on the client side.

You are correct that Deja Dup is a front end for Duplicity. If Deja Dup does use SFTP by default and dropbear does not support it that could be the issue right there. Seems a bit misleading as the pull-down in Deja Dup and "Connect to Server" is for SSH not SFTP so I guess I thought it was using SSH.
 
You are correct that Deja Dup is a front end for Duplicity. If Deja Dup does use SFTP by default and dropbear does not support it that could be the issue right there. Seems a bit misleading as the pull-down in Deja Dup and "Connect to Server" is for SSH not SFTP so I guess I thought it was using SSH.
It's very common for software to say SSH instead of SFTP. The logic being that SFTP is an extension of the SSH protocol. Plain SSH itself is just a shell and doesn't really have a built-in file transfer, that's what SCP and SFTP do.

Can you try using normal FTP instead.
 
after doing a bit of digging it does seem that both deja dup and "Connect to Server" want to use sftp when you tell it to use ssh. I also messed around with the Samba share a bit and could get working without a password, but never got it to work when using a password to login.

Seems like my options are:
1) find a way to use sftp on the rounter -- looks like it may be possible, but probably out of my ability / comfort level of modifications.
2) be OK with Samba and no password...
3) don't bother with the hard drive attached to router and do backups another way

Maybe other options but is what I see as the most straight forward for now.
 
What about FTP? It's a lightweight protocol (plain text, no encryption) so is fast. Much faster than SMB/CIFS. Easy to setup.
 
Seems like my options are:
1) find a way to use sftp on the rounter -- looks like it may be possible, but probably out of my ability / comfort level of modifications.
On Merlin, if you install Entware-NG, then the openssh-sftp-server package, dropbear is configured to recognize that package and provide sftp support. I just tried it on my fork (after picking up a patch...it doesn't work on V18 right now) and it does work.
 
On Merlin, if you install Entware-NG, then the openssh-sftp-server package, dropbear is configured to recognize that package and provide sftp support. I just tried it on my fork (after picking up a patch...it doesn't work on V18 right now) and it does work.

Thanks for the suggestion! I have been able to get ftp working (thanks for the suggestion ColinTaylor!) with Deja Dup, but have not gotten a chance to try it with a rsync based backup yet. If ftp doesn't work with rsync you gave me another option to try, which is great!
 
If you want to use rsync then you'll need to install rsync on the router as well. So that means installing entware...

AFAIK rsync can (and does) use SSH as its transport mechanism* (not SCP - but I might be wrong), in which case there's no need to install SCP. And so we come full circle! :eek:

* Or you can run rsync as a daemon and use its own transport mechanism.
 
ColinTaylor and john9527,

Thanks for all your assistance. As you are both aware (and now I am also!) rsync doesn't work over FTP. Looks like the next step would be installing Entware. Briefly looking at the wiki it looks straightforward enough, but I want to read a bit more to be come comfortable with it before I dive right in.

One quick question: Looks like Entware and the programs install to a usb drive? Is that correct?

If so I am thinking I would be best off using the other USB port and setting up a "dedicated" USB drive there in case I want to swap out my backup drive. I will have to see what size makes sense. Ok enough typing, time to read about Entware.

Thanks again!
 
One quick question: Looks like Entware and the programs install to a usb drive? Is that correct?
Yes, correct....and it needs to be formatted ext3/4. I used a USB stick, that I preformatted with GParted. It also holds my swap file. (And a second ntfs partition that holds my NVRAM Save/Restore utility...I tend to do some strange things to stress my fork :) )

Then, like you suggested, the other USB port is an hdd that holds some media files for testing Media Server and for sharing files on my LAN via SMB/NFS.
 
Well I thought I would try find a program to use just simple FTP instead of installing Entware, but was unsuccessful (FullSync came the closest to working).

So I finally broke down and installed Entware:
Code:
entware-setup.sh
and openssh-sftp-server
Code:
opkg install openssh-sftp-server
but I couldn't get it to work until I also installed rsync
Code:
opkg install rsync

I was confused for a bit trying to get it to work until I realized I needed to install rsync. :oops:

Seems to be working with no problems now! Thanks again for all your help!
 

Sign Up For SNBForums Daily Digest

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