Scp, ddns, ssh problem

Hi,

ok, here the problem, I found a workaround but I wonder if I can do it otherwise.

This morning I installed and configured DDNS (dynu) and now I can't using scp correctly. Scp from my local pc to OpenWrt router is ok, but scp from my router to pc, or ie; scp root@192.168.1.1:/tmp/backup-*.tar.gz james@pop-os:/media/james/E/openWrt_backup did not work.

kind of error ;

kex_exchange_identification: read: Connection reset by peer
Connection reset by 169.150.204.5 port 22 or sometimes ; port 22: Connection refused

But, it is working if I comment (#) my ddns domain line in my ubuntu config file ; /etc/resolv.conf

nameserver 127.0.0.53
options edns0 trust-ad
#search Ninjanoir78.ddnsfree.com

here my openwrt dhcp

root@james:~# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '0'
        option local '/lan/'
        option domain 'Ninjanoir78.ddnsfree.com'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option ednspacket_max '1232'
        option cachesize '1000'
        option port '54'
        list server '192.168.1.1'
        option serversfile '/var/run/adblock-fast/dnsmasq.servers'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '24h'
        option dhcpv4 'server'
        option force '1'
        list dhcp_option '6, 192.168.1.1'
        list dhcp_option '3, 192.168.1.1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

So if you have a solution to keep it that working without a need to comment the domain line, or do I really need it in my ubuntu resolv.conf ?
thanks

try disabling client lookups for your Ubuntu's sshd (UseDNS no), but it probably won't help.
read the Ubuntu's sshd log.

1 Like

try disabling client lookups for your Ubuntu's sshd (UseDNS no).

only that does not work.

check the log, you might need to enable some old encryption in sshd.

same thing on my pop-os pc (based on ubuntu)

2024-12-28T16:07:37.167295-05:00 pop-os rtkit-daemon[1363]: Supervising 6 threads of 3 processes of 1 users.
2024-12-28T16:07:37.176756-05:00 pop-os rtkit-daemon[1363]: Supervising 6 threads of 3 processes of 1 users.
2024-12-28T16:08:02.297125-05:00 pop-os cosmic-comp[2151]: Client bug: Unable to re-configure repositioned popup.
2024-12-28T16:08:29.194726-05:00 pop-os Dynu.Core.Service[1259]: Dynu.Core.Service.Worker[0] IPv4 address update not required.
2024-12-28T16:08:29.195319-05:00 pop-os Dynu.Core.Service[1259]: Dynu.Core.Service.Worker[0] IPv6 address update not required.
2024-12-28T16:08:29.195377-05:00 pop-os Dynu.Core.Service[1259]: Dynu.Core.Service.Worker[0] Current IPv4 Address: 169.150.204.52
2024-12-28T16:08:29.195432-05:00 pop-os Dynu.Core.Service[1259]: Dynu.Core.Service.Worker[0] Current IPv6 Address: Disabled
2024-12-28T16:09:04.155403-05:00 pop-os geoclue[2549]: Failed to query location: Query location SOUP error: Not Found
2024-12-28T16:09:05.966392-05:00 pop-os geoclue[2549]: Failed to query location: Query location SOUP error: Not Found
2024-12-28T16:09:20.706602-05:00 pop-os rtkit-daemon[1363]: Supervising 6 threads of 3 processes of 1 users.
2024-12-28T16:09:26.834034-05:00 pop-os rtkit-daemon[1363]: message repeated 7 times: [ Supervising 6 threads of 3 processes of 1 users.]
2024-12-28T16:09:28.149756-05:00 pop-os systemd[2074]: Started app-cosmic-com.system76.CosmicAppList-11729.scope - Application launched by COSMIC.
2024-12-28T16:09:54.856454-05:00 pop-os cosmic-comp[2151]: Client bug: Unable to re-configure repositioned popup.

as I said, everything worked just before I added my ddns

I don't use Ubuntu, but is there a /var/log/secure ?

/var/log$ ls
alternatives.log  boot.log.1  bootstrap.log  dmesg.1.gz      gpu-manager.log  lastlog            syslog.2.gz
apt               boot.log.2  btmp           dmesg.2.gz      journal          openvpn            syslog.3.gz
auth.log          boot.log.3  chrony         dmesg.3.gz      kernelstub.log   private            ufw.log
auth.log.1        boot.log.4  cups           dmesg.4.gz      kern.log         README             ufw.log.1
auth.log.2.gz     boot.log.5  cups-browsed   dpkg.log        kern.log.1       speech-dispatcher  wtmp
auth.log.3.gz     boot.log.6  dmesg          faillog         kern.log.2.gz    syslog
boot.log          boot.log.7  dmesg.0        fontconfig.log  kern.log.3.gz    syslog.1

I will check if one of those would be more verbose

I'd check syslog.

syslog is the one I've put here

then check auth.log, like I said, I'm only guessing :slight_smile:

1 Like

btw, first time I setup ddns, I really need my domain name in my resolf.conf on my pc? It has been automatically add it there

When logged into your openwrt router, can you ssh back to your pop-os device without errors:

ssh james@pop-os

I assume you restarted sshd afterwards ?

1 Like

does not work

debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/james/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/james/.ssh/known_hosts2'
debug2: resolving "server" port 22
debug3: resolve_host: lookup server:22
debug3: channel_clear_timeouts: clearing
debug3: ssh_connect_direct: entering
debug1: Connecting to server [169.150.204.52] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: Connection established.
debug1: identity file /home/james/.ssh/id_rsa type -1
debug1: identity file /home/james/.ssh/id_rsa-cert type -1
debug1: identity file /home/james/.ssh/id_ecdsa type -1
debug1: identity file /home/james/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/james/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/james/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/james/.ssh/id_ed25519 type 3
debug1: identity file /home/james/.ssh/id_ed25519-cert type -1
debug1: identity file /home/james/.ssh/id_ed25519_sk type -1
debug1: identity file /home/james/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/james/.ssh/id_xmss type -1
debug1: identity file /home/james/.ssh/id_xmss-cert type -1
debug1: identity file /home/james/.ssh/id_dsa type -1
debug1: identity file /home/james/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.5
kex_exchange_identification: read: Connection reset by peer
Connection reset by 169.150.204.52 port 22
2024-12-28T16:29:15.031145-05:00 pop-os sudo: pam_unix(sudo:session): session opened for user root(uid=0) by james(uid=1000)
2024-12-28T16:29:15.035231-05:00 pop-os sudo: pam_unix(sudo:session): session closed for user root
2024-12-28T16:33:08.999818-05:00 pop-os sudo:    james : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/bin/apt-get install openssh-server
2024-12-28T16:33:09.000715-05:00 pop-os sudo: pam_unix(sudo:session): session opened for user root(uid=0) by james(uid=1000)
2024-12-28T16:33:09.709657-05:00 pop-os sudo: pam_unix(sudo:session): session closed for user root
2024-12-28T16:41:44.223162-05:00 pop-os sudo:    james : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/bin/systemctl status ssh
2024-12-28T16:41:44.232583-05:00 pop-os sudo: pam_unix(sudo:session): session opened for user root(uid=0) by james(uid=1000)
2024-12-28T16:42:07.160551-05:00 pop-os sudo: pam_unix(sudo:session): session closed for user root
2024-12-28T16:42:10.980626-05:00 pop-os sudo:    james : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/bin/systemctl restart ssh
2024-12-28T16:42:10.983914-05:00 pop-os sudo: pam_unix(sudo:session): session opened for user root(uid=0) by james(uid=1000)
2024-12-28T16:42:10.992711-05:00 pop-os sshd[9037]: Received signal 15; terminating.
2024-12-28T16:42:11.050882-05:00 pop-os sshd[13583]: Server listening on :: port 22.
2024-12-28T16:42:11.053350-05:00 pop-os sudo: pam_unix(sudo:session): session closed for user root
2024-12-28T16:42:18.116714-05:00 pop-os sudo:    james : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/sbin/service ssh restart
2024-12-28T16:42:18.118240-05:00 pop-os sudo: pam_unix(sudo:session): session opened for user root(uid=0) by james(uid=1000)
2024-12-28T16:42:18.133593-05:00 pop-os sshd[13583]: Received signal 15; terminating.
2024-12-28T16:42:18.214609-05:00 pop-os sshd[13594]: Server listening on :: port 22.
2024-12-28T16:42:18.217743-05:00 pop-os sudo: pam_unix(sudo:session): session closed for user root

Did you get an error? What was it?

1 Like

nothing happens

Nothing at all?

Maybe a dns issue?

1 Like

Keep in mind your Ubuntu box isn't using your router's DNS server, unless it's blocked upstream.