ssh slow during logon, when ENTERING INTERACTIVE SESSION
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ConsoleKit |
Fix Released
|
Undecided
|
Unassigned | ||
portable OpenSSH |
Fix Released
|
Undecided
|
Unassigned | ||
openssh (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I am using a Ubuntu Intrepid 32 bit server with all latest patches.
Logging on via ssh (USING KEYS) is incredibly, painfully slow.
I have done some investigation.
1. Slowness is mild after a reboot and, as time goes on, it becomes progressively slower and sloowweerr and ssslllooowwweee
2. If I run ssh -v, then I can see that the ssh process is stuck for many seconds after saying "entering interactive session".
3. This even happens if I do, from that server, a command "ssh localhost".
4. Disabling GSSAPI authentication, as well as saying "UseDNS no", in sshd_config, does not help.
5. A similar problems applies to use of "su" and can be more easily debugged. If, as root, I say "su - <username> date", it is also incredibly slow. If I debug that with
strace -o q -f su - <myuserid> date
then I see that su tries to connect to UNIX socket /var/run/
munmap(
close(4) = 0
socket(PF_FILE, SOCK_STREAM, 0) = 4
connect(4, {sa_family=AF_FILE, path="/
fcntl(4, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl(4, F_GETFD) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
geteuid() = 0
poll([{fd=4, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
write(4, "\0", 1) = 1
write(4, "AUTH EXTERNAL 30\r\n", 18) = 18
poll([{fd=4, events=POLLIN, revents=POLLIN}], 1, -1) = 1
read(4, "OK 951631a86cc3500
poll([{fd=4, events=POLLOUT, revents=POLLOUT}], 1, -1) = 1
write(4, "BEGIN\r\n", 7) = 7
poll([{fd=4, events=
writev(4, [{"l\1\
gettimeofday(
poll([{fd=4, events=POLLIN, revents=POLLIN}], 1, 25000) = 1
read(4, "l\2\1\
read(4, 0x24686e0, 2048) = -1 EAGAIN (Resource temporarily unavailable)
writev(4, [{"l\1\
gettimeofday(
poll(
Changed in openssh (Ubuntu): | |
status: | Invalid → Fix Released |
Changed in openssh: | |
status: | Invalid → Fix Released |
Changed in consolekit: | |
status: | Invalid → Fix Released |
I think that I have a track. Based on similar "su" problems, I decided to explore the possibility that it is the fault of "dbus". Based on results below, I believe it to be the case and I reassign this issue to "dbus". Restarting dbus fixes this issue.
So I did:
1) time how long ssh to localhost takes:
==>time ssh localhost date
Thu Nov 20 22:55:54 CST 2008
real 0m0.248s
user 0m0.000s
sys 0m0.004s
2) Restarted dbus as root:
root:~ ###/etc/init.d/dbus restart tools-backends tools-backends
* Stopping System Tools Backends system-
...done.
* Stopping bluetooth
...done.
* Stopping Hardware abstraction layer hald
...done.
* Stopping system message bus dbus
...done.
* Starting system message bus dbus
...done.
* Starting Hardware abstraction layer hald
...done.
* Starting bluetooth
...done.
* Starting System Tools Backends system-
...done.
(this killed gnome-panel and stuff also, no biggy)
3) tried ssh again:
==>time ssh localhost date
Thu Nov 20 22:56:06 CST 2008
real 0m0.268s
user 0m0.000s
sys 0m0.008s
So restarting dbus fixed this issue.