In my program, ssh
"normally" takes around 0.3s, however sometimes it may take more than 2s.
I wonder whether this is a normal variation for ssh's execution time, and whether there is some thing I can do to get rid of the occasional 2s.
Things I've tried/read about so far:
- Disable the use of module
pam_systemd
in PAM config file/etc/pam.d/system-auth-ac
: this does help; I used to bump into extra long ssh execution time of over 15s and disablingpam_systemd
fixed this. - Set
UseDNS
tono
(as suggested in it takes too long to connect to ssh server): my default setting insshd_config
isno
so I think this is irrelevant to my problem. Comment out these 2 lines in
sshd_config
(from this question) :GSSAPIAuthentication yes GSSAPIDelegateCredentials no
I tried but it didn't help in my case.
SELinux
: disabled.
Are there any other suggestions?
Thanks in advance!
Update
I found that the 2s execution time is not due to ssh connection, but due to the command sent through ssh -- so it is not a problem with ssh.
I'd rather not delete this question in hope that the methods I've tried could be of some help.
Thanks!