NetAdminTools.com
 
SignalQ Sites:
NetAdminTools - Coprolite - SpotBridge - NAW
RoboCoop - AreWeDown - SolarPower - SysAdminTools
Xfig - Gold Loaf - GeekPapa - FixGMC - FixRambler
Categories:
GNU/Linux | Homebrew designs | Perl | Ruby | Administration | Backup/Recovery | Bugs/Fixes | Certification | Database | Email | File/Print | Hardware | Information Grab Bag | Interoperability | GNU/Linux ABCs | Monitoring | Name Resolution | Network Services | Networking | Remote Control | Security | Desktop | Web | BSD | Solaris | GIAGD | ERP | REALbasic

Last 30 Days | Last 60 Days | Last 90 Days | All Articles | GNU/Linux Reference OS Build | MCJ How-to | MCJ Presentation Config | Keywords | RSS



Categories:
·GNU/Linux
·Homebrew designs
·Perl
·Ruby
·Administration
·Backup/Recovery
·Bugs/Fixes
·Certification
·Database
·Email
·File/Print
·Hardware
·Information Grab Bag
·Interoperability
·GNU/Linux ABCs
·Monitoring
·Name Resolution
·Network Services
·Networking
·Remote Control
·Security
·Desktop
·Web
·BSD
·Solaris
·GIAGD
·ERP
·REALbasic
·All Categories


Fix Slow SSH Login Time
Topic:Remote Control   Date: 2009-02-03
Printer Friendly: Print

spacerspacer
<<  <   >  >>

Subject

If your login times are really high, it may be that reverse DNS is not working correctly. We have an ISP whose DNS servers sometimes don't respond to reverse DNS queries. It was a bit of a puzzle because it has worked for a long time. Our hunch is that the recent DOS attacks have made name resolution a little fragile lately. The symptom shows up in the logs:

tail /var/log/secure

We have keys set up, but notice that there is a fifteen second delay from accepting the key to opening a session:

Feb  3 09:48:45 main sshd[9692]: Accepted publickey for root from 1.6.4.2 port 57559 ssh2
Feb  3 09:49:00 main sshd[9692]: pam_unix(sshd:session): session opened for user u1 by (uid=0)

The fix is to either add the IP address to /etc/hosts, or modify your sshd_config file (for us the path is /etc/ssh/sshd_config) and set UseDNS to no:

#ShowPatchLevel no
UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10

Restart sshd for the change to take effect:


# /etc/init.d/sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
#

Now we get a quick login:

Feb  3 10:06:49 main sshd[12160]: Accepted publickey for root from 1.6.4.2 port 57528 ssh2
Feb  3 10:06:49 main sshd[12160]: pam_unix(sshd:session): session opened for user u1 by (uid=0)


People:
Places:
Things:
Times:





Please read our Terms of Use and our Privacy Policy
Microsoft, Windows, Windows XP, Windows 2003, Windows 2000, and NT are either trademarks or registered trademarks of Microsoft Corporation. NetAdminTools.com is not affiliated with Microsoft Corporation. Linux is a registered trademark of Linus Torvalds, and refers to the Linux kernel. The operating system of most distributions that contain the Linux kernel is GNU/Linux. All logos and trademarks in this site are property of their respective owner. Copyright 1997-2010 NetAdminTools.com