SUSE Support

Here When You Need Us

logout of ssh sessions delayed for seconds for root

This document (7009365) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 11 Service Pack 2
SUSE Linux Enterprise Desktop 11 Service Pack 2

Situation

When logging off a ssh session connected to a SLE11SP2 based system, an unusual high delay (~24 seconds) is experienced. Settings the sshd into debug mode shows long wait times on
 
debug1: session_pty_cleanup: session 0 release /dev/pts/2

Checking the process using strace with time stamps (strace -r -f -o filename.txt ssh user@hostname) reveals:
 
3947       0.000053 select(7, [3 4], [], NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
3947      14.296950 --- SIGWINCH (Window changed) @ 0 (0) ---
3947       0.000047 rt_sigaction(SIGWINCH, NULL, {0x7f1f0a9fd860, [], SA_RESTORER, 0x7f1f08675bf0}, 8) = 0
3947       0.000074 rt_sigreturn(0x1c)  = -1 EINTR (Interrupted system call)
3947       0.000068 ioctl(4, TIOCGWINSZ, {ws_row=72, ws_col=192, ws_xpixel=0, ws_ypixel=0}) = 0
3947       0.000082 select(7, [3 4], [3], NULL, NULL) = 1 (out [3])
3947       0.000074 write(3, " \320_W\22\6\234\342\210\260oC\246\243\203\366\225C\367\367\246.\344\362^\334\373TD\222\237\243"..., 64) = 64
3947       0.000096 select(7, [3 4], [], NULL, NULL) = 1 (in [3])
3947      10.740011 read(3, "\362p`\23\233\\\351\21p\17E\245\202\325\364\366\360\202\211\263/\3432\2+\335\362\223\36\340\266]"..., 8192) = 160
3947       0.000097 close(4) 

This issue is only encountered for the root user, not normal users. Tracing the network traffic shows DNS A and AAAA queries which timeout.

Resolution

Please update to openssh-5.1p1-41.55.1 or later.

Cause

This issue may get experienced if /etc/resolv.conf contains nameserver entries which cannot be queried by the client. While root quits the ssh session, a DNS A and AAAA query is sent which times out and causes the delay. One situation where is is experienced is when bind9 was configured as caching-only nameserver.

Workaround:
Please check which nameserver cannot be queried by the client and remove the entry from /etc/resolv.conf.

Additional Information

In addition to the mentioned available fix, /etc/ssh/sshd_config needs to be edited and the default setting
 
#UseDNS yes

needs to be changed to
 
UseDNS no

Restart sshd to apply the change:
 
rcsshd restart

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7009365
  • Creation Date: 12-Jun-2012
  • Modified Date:28-Sep-2022
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.