SSH from NAS to Webserver (ssh/config)

Backup, Restore, Netbak Replicator, Cloud Storage Services
Post Reply
Ben_beton
Know my way around
Posts: 148
Joined: Tue Jan 18, 2011 6:08 pm

SSH from NAS to Webserver (ssh/config)

Post by Ben_beton » Tue Mar 01, 2016 10:00 pm

Hi,

I wan't to backup my webserver on my nas.
The webserver is reachable und secured with a keyfile.

I saved my ssh connection config to ~/.ssh/config
there I store my keyfile too.

now when trying to open a ssh session from the nas to my webserver (ssh webserver) it gives me an error "could not resolve webserver: Name or service not known"

seems that ssh is not using the config file. It is working on my MacBook. Is there a difference betwenn ssh on qnap or did I missed something?!

QTS 4.2.0 Build 20160130
TS-251 - QTS 4.3.3.0210 build 20170606

kirkgbr
Know my way around
Posts: 121
Joined: Sun Jul 12, 2015 10:34 pm

Re: SSH from NAS to Webserver (ssh/config)

Post by kirkgbr » Wed Mar 02, 2016 12:07 am

Typically "could not resolve xxxxxx" means something wrong with DNS or name service or hosts file. You might try ssh'ing to the webserver via it's IP address to exclude the name service problem.
NAS Model:TS-453 Pro
RAM: 8Gig
Firmware: 4.1.4 Build 20150804
Drives: 2 * WD30EFRX
Network: GigE

Ben_beton
Know my way around
Posts: 148
Joined: Tue Jan 18, 2011 6:08 pm

Re: SSH from NAS to Webserver (ssh/config)

Post by Ben_beton » Wed Mar 02, 2016 2:06 pm

yes, ssh is trying to resolve "webserver" but webserser is only the host name in the config and not the fqdn to connect to. Thats why I'm thinking ssh is not using the config file stored in ~/.ssh/

any ideas?
TS-251 - QTS 4.3.3.0210 build 20170606

kirkgbr
Know my way around
Posts: 121
Joined: Sun Jul 12, 2015 10:34 pm

Re: SSH from NAS to Webserver (ssh/config)

Post by kirkgbr » Wed Mar 02, 2016 8:57 pm

My guess is something wrong with your ~/.ssh/config file.

I have duplicated your problem here on my QNAP.

Code: Select all

$ cat ~/.ssh/config
Host webserver
        Hostname webserver.local
        User user1
       
$ ssh webserver
ssh: Could not resolve hostname webserver.local: Name or service not known       
       

However, If I place a resolvable name on the "Hostname" line above it works fine.
NAS Model:TS-453 Pro
RAM: 8Gig
Firmware: 4.1.4 Build 20150804
Drives: 2 * WD30EFRX
Network: GigE

Ben_beton
Know my way around
Posts: 148
Joined: Tue Jan 18, 2011 6:08 pm

Re: SSH from NAS to Webserver (ssh/config)

Post by Ben_beton » Wed Mar 02, 2016 9:14 pm

yes this is working but on my site I defined to use a keyfile and this keyfile is not used, only hostname and user are being used.

glad to see that ssh webserver is not only a problem on my nas.

I figured out, that it work if I specify -F /patch/to/config (~/.ssh/config)
btw. thanks for the sample, that is helping to understand the issue.

I'm thinking about switching to OpenSSH, maybe then it will work, but it would be best if it works out of the box
TS-251 - QTS 4.3.3.0210 build 20170606

kirkgbr
Know my way around
Posts: 121
Joined: Sun Jul 12, 2015 10:34 pm

Re: SSH from NAS to Webserver (ssh/config)

Post by kirkgbr » Wed Mar 02, 2016 9:49 pm

Hope you understand that in my example above, "webserver.local" is NOT resolvable and I chose this name to prove the point. If I put a resolvable hostname in there, the config works as expected with "out of the box" ssh.
NAS Model:TS-453 Pro
RAM: 8Gig
Firmware: 4.1.4 Build 20150804
Drives: 2 * WD30EFRX
Network: GigE

Ben_beton
Know my way around
Posts: 148
Joined: Tue Jan 18, 2011 6:08 pm

Re: SSH from NAS to Webserver (ssh/config)

Post by Ben_beton » Wed Mar 02, 2016 10:09 pm

ok, now its clear, so the issue is only on my side ;) is your signature FW Version 4.1.4 the FW you tested on? I'm running 4.2.0 as postet above, maybe there is someone who is using 4.2.0 and can or can't reproduce the issue
TS-251 - QTS 4.3.3.0210 build 20170606

egerards
New here
Posts: 2
Joined: Thu Sep 24, 2009 5:40 pm

Re: SSH from NAS to Webserver (ssh/config)

Post by egerards » Mon Jun 13, 2016 6:17 pm

I'm also using FW 4.2.0 and a couple of days ago I created a ~/.ssh/config file and noticed that this file is completely being ignored. When I do an 'ssh -F ~/.ssh/config <short_name>' then it works. For some reason the ssh client is ignoring ~/.ssh/config unless explicitly specified via the '-F' parameter.

Ben_beton
Know my way around
Posts: 148
Joined: Tue Jan 18, 2011 6:08 pm

Re: SSH from NAS to Webserver (ssh/config)

Post by Ben_beton » Wed Jun 22, 2016 2:07 pm

thank you for the hint, it's not working on my side. I opened a ticket a few days ago, lets wait and see if the support can help.
TS-251 - QTS 4.3.3.0210 build 20170606

redfish907
First post
Posts: 1
Joined: Thu May 26, 2016 11:43 am

Re: SSH from NAS to Webserver (ssh/config)

Post by redfish907 » Fri Jul 08, 2016 3:22 am

Did you receive a response for the ticket? I have the same issue, and am trying to find a solution. My config files is correct, but it seems as though ssh is ignoring the file.

Ben_beton
Know my way around
Posts: 148
Joined: Tue Jan 18, 2011 6:08 pm

Re: SSH from NAS to Webserver (ssh/config)

Post by Ben_beton » Sun Jul 10, 2016 10:14 pm

they replied:

Your request is recognized as feature request. It is forwared to our development and this ticket als technical problem must be closed.


then I asked, why a working thing is now a feature request:

If the standard ssh does not work at all, we will fix. But for personaly generated ssh key, we will not support any more.


I think, that's it
TS-251 - QTS 4.3.3.0210 build 20170606

provenal
New here
Posts: 2
Joined: Thu Mar 30, 2017 3:29 am

Re: SSH from NAS to Webserver (ssh/config)

Post by provenal » Fri Mar 31, 2017 2:22 am

This seems to still be an issue and can't find anything about the ssh client not reading the default config file using the built-in ssh.

Am on a TS-EC1280U
Firmware version 4.2.2 Build 20161102

Code: Select all

# ssh -V
OpenSSH_7.3p1, OpenSSL 1.0.1u  22 Sep 2016
Units: 3 x 12 bay TS-EC1280U
Firmware: 4.2.2 Build 20161102

falloutphil
First post
Posts: 1
Joined: Tue Oct 27, 2020 5:39 am

Re: SSH from NAS to Webserver (ssh/config)

Post by falloutphil » Tue Oct 27, 2020 8:03 am

Agree this is breaking from the specified OpenSSH behaviour - it's a bug not a feature to restrict this without documenting it - still present on latest OS for x53D series:

[~] # uname -a
Linux NAS 4.14.24-qnap #1 SMP Sat Oct 24 05:11:24 CST 2020 x86_64 GNU/Linux
[~] # ssh -V
OpenSSH_8.0p1, OpenSSL 1.0.2s 28 May 2019
[~] #

Post Reply

Return to “Backup & Restore”