× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Re: SSH Login Slow on ReadyNAS Duo

rabidh
Aspirant

SSH Login Slow on ReadyNAS Duo

Hi,

I'm not expecting SSH file transfers to be hugely fast given the duo isn't exactly a powerhouse, but what's a bit of a shame is the amount of time it takes just to log in. If I do:

time ssh nas echo test

Through gigabit ethernet then it takes over 3 seconds, whereas if I connect to a server 50 miles away through relatively slow broadband it takes 0.7 seconds.

If I turn on verbose mode I get the following information:
OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /home/gw/.ssh/config
debug1: Applying options for nas
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to nas.local [192.168.1.234] port 22.
debug1: Connection established.
debug1: identity file /home/gw/.ssh/identity type -1
debug1: identity file /home/gw/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/gw/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3p2 Debian-5~bpo.1.netgear1
debug1: match: OpenSSH_4.3p2 Debian-5~bpo.1.netgear1 pat OpenSSH_4*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu7
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'nas.local' is known and matches the RSA host key.
debug1: Found key in /home/gw/.ssh/known_hosts:74
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/gw/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_GB.utf8
debug1: Sending command: echo test
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0

And it stops at 'SSH2_MSG_KEX_DH_GEX_REPLY' for the majority of the time.

It also gives the following in auth.log:

Oct 3 15:51:07 nas sshd[31199]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
Oct 3 15:51:07 nas sshd[31199]: WARNING: /etc/ssh/moduli does not exist, using fixed modulus
Oct 3 15:51:10 nas sshd[31199]: Accepted publickey for gw from 192.168.1.6 port 59656 ssh2
Oct 3 15:51:10 nas sshd[31201]: (pam_unix) session opened for user gw by (uid=0)
Oct 3 15:51:10 nas pam_limits[31201]: can not read settings from /etc/security/limits.conf
Oct 3 15:51:10 nas pam_limits[31201]: error parsing the configuration file
Oct 3 15:51:10 nas PAM-env[31201]: Unable to open config file: No such file or directory
Oct 3 15:51:10 nas sshd[31199]: lastlog_filetype: Couldn't stat /var/log/lastlog: No such file or directory
Oct 3 15:51:10 nas sshd[31199]: lastlog_openseek: /var/log/lastlog is not a file or directory!
Oct 3 15:51:10 nas sshd[31199]: lastlog_filetype: Couldn't stat /var/log/lastlog: No such file or directory
Oct 3 15:51:10 nas sshd[31199]: lastlog_openseek: /var/log/lastlog is not a file or directory!

Is this expected? If there anything I can do to speed up this process?
I have some scripts that check things via ssh login, and having this kind of delay totally kills the performance of them.

I've already set UseDNS to no just in case, and using different encryption only shaves 0.1sec off the connection time.

thanks!
Message 1 of 6
chirpa
Luminary

Re: SSH Login Slow on ReadyNAS Duo

Reverse DNS lookup is probably the bulk of the delay.
Message 2 of 6
linarms
Aspirant

Re: SSH Login Slow on ReadyNAS Duo

Hi,

I'm having the same issue here.

DNS is fine (reverse lookups are instantaneous), and the sshd process chews CPU for a while before presenting a login prompt.

From watching auth_log while logging in over SSH, I suspect the issue is the non-existence of a moduli file.

I don't claim to understand the cryptography involved, but am in the process of running this command:

ssh-keygen -G /tmp/moduli-2048.candidates -b 2048

Which I will follow with:

ssh-keygen -T /etc/moduli -f /tmp/moduli-2048.candidates

(These commands take a while to run.)

Will report results as soon as I have them 🙂
Message 3 of 6
linarms
Aspirant

Re: SSH Login Slow on ReadyNAS Duo

No luck, sadly. It's a little faster negotiating the initial connection now, but beyond that, I think the encryption setup is just processor intensive, and ReadyNAS boxes have no processing power whatsoever 😞
Message 4 of 6
StephenB
Guru

Re: SSH Login Slow on ReadyNAS Duo

Of course the ultra and pro lines do have much faster processors. 🙂
Message 5 of 6
linarms
Aspirant

Re: SSH Login Slow on ReadyNAS Duo

StephenB wrote:
Of course the ultra and pro lines do have much faster processors. 🙂


Yup, you get what you pay for 🙂

The fact that I can do so much customising on my NV+ for AUD$315 (without drives) is incredible regardless ... the sub-Atom-powered processor is unfortunate but not a deal-breaker.

I especially notice it when initialising large unison sets, but it should perform adequately once everything is migrated.
Message 6 of 6
Top Contributors
Discussion stats
  • 5 replies
  • 1361 views
  • 0 kudos
  • 4 in conversation
Announcements