Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Problems Logging Server

  1. #1
    Join Date
    Aug 2008
    Beans
    18

    Problems Logging Server

    I've had my home server up and running for some time now with no issues. Over the last few months there seems to be an issue logging in with SSH or SFTP when logging in the first attempt don't work, it usually takes two or three times until the server will allow a connection. I have another server that lets me in on the first try. What would be causing this issue? Both servers are Ubuntu Sever 12.04

  2. #2
    Join Date
    Mar 2010
    Location
    Punta Natales, Chile
    Beans
    12,357
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Problems Logging Server

    What do the log files on both the client and server show?
    Have you tried using the IP address directly?
    Any recent changes to DNS or /etc/hosts files?
    Using key-based authentication or passwords?
    Capslock?

    Is this on the LAN or over the internet? Is there a router involved?

  3. #3
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,048
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Problems Logging Server

    How much RAM in each? If the ssh daemon is swapped out of memory, that could cause a delay in authentication resulting in a failed attempt for the first time. Does one server have more memory than the other? How many processes are running on each? Are either running virtual machines? If so, how many?
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  4. #4
    Join Date
    Aug 2008
    Beans
    18

    Re: Problems Logging Server

    Thanks for the replies. This morning I went to login the server that wasn't given me problems, and now that one is doing the same thing. I have it tracked down to my router, I have DHCP Reservation set for both machines. Last night I added the other server in the router to tell it what IP to use.

    Would it be best for the router to hand out IP's using DHCP Reservation or set all this in the config files for the server?

  5. #5
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,048
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Problems Logging Server

    Generally you want manually-assigned IP's for this reason. The ssh daemon consults a file that has the encrypted passwords associated with the IP of the attempting remote machine. If your IP's are changing with DHCP, then ssh will have multiple entries with the same password, which creates a problem. DHCP is used for casual users. If you are using ssh, you are no longer a casual user.

    And since you are no longer a casual user, you have some reading to do: https://help.ubuntu.com/community/SS...SH/Configuring

    Also, make sure you have the same /etc/hosts file on each machine with the correct, manual IP's defined.
    Last edited by tgalati4; November 2nd, 2013 at 02:11 PM.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  6. #6
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,968
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Problems Logging Server

    If you are using your router as the DNS server, you may be able to add hostname records for the servers whose IPs you set up manually. If so, that is far preferable to maintaining hosts files on any clients.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  7. #7
    Join Date
    Mar 2010
    Location
    Punta Natales, Chile
    Beans
    12,357
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Problems Logging Server

    Quote Originally Posted by unsoc View Post
    Would it be best for the router to hand out IP's using DHCP Reservation or set all this in the config files for the server?
    In a home environment, where to use DHCP reservations or not is a personal preference, but there are issues. What happens when the router fails? That does happen from time to time.

    I use a mix of DHCP reservations and static IP setups.
    * DHCP reservations are only used for portable devices - Android phones, tablets, laptops, netbooks.
    * Manually configured static IPs are used for desktops, servers and VMs. I centrally manage a /etc/hosts file and can redeploy it easily to all -server- systems through Ansible templates.

    There are times when both methods suck and there are times with both methods work perfectly. I see both cases here.

    I would strongly suggest that you use static IPs manually configured and push /etc/hosts files out. In this way a network issue with the switch, router, cables doesnt mean that DNS has failed for internal name resolving. That can be very nice when trying to solve issues like you are seeing .... which, BTW, may still be 100% due to your router or cables.

    BTW, my /etc/hosts file is about 12,000 lines - mostly blocking ad networks, but also tracking networks and just nasty parts of the internet like cnbc7.com. The internal DNS server has this same hosts file, so Android devices (not rooted) don't get screwed too much. You can read about it on lifehacker.com
    Last edited by TheFu; November 1st, 2013 at 06:50 PM.

  8. #8
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,048
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Problems Logging Server

    I follow the advice of TheFu on my home network, a mixture of DHCP and static IP's for fixed computers and laptops that I do development work on. Maintaining host files is not an issue if you have a NAS or at least one device that has a network file share, then you can grab the updated host file addendum and either cut and paste or simply ssh into the server and cut and paste the host entries to the new machine.

    Using ssh from mobile devices can be problematic, but you can set long DHCP lease times, so that your IP addresses don't change that often.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  9. #9
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,968
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Problems Logging Server

    I run bind9 on a server and manage all my name services that way. I hate using hosts files.

    I don't use host files for adblocking or anything like that either. I find it's much easier letting AdBlockPlus and Ghostery handle these things at the browser level. At a client site, though, we push every request through Squid and impose all the blocking there. It's a lot easier than managing 200+ workstations!
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  10. #10
    Join Date
    Mar 2010
    Location
    Punta Natales, Chile
    Beans
    12,357
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Problems Logging Server

    Quote Originally Posted by SeijiSensei View Post
    I run bind9 on a server and manage all my name services that way. I hate using hosts files.

    I don't use host files for adblocking or anything like that either. I find it's much easier letting AdBlockPlus and Ghostery handle these things at the browser level. At a client site, though, we push every request through Squid and impose all the blocking there. It's a lot easier than managing 200+ workstations!
    Servers need to come up, be on the network, and provide services regardless of DNS or DHCP working, IMHO.

    I hate using hosts files too. At least using ansible (or a simple perl filter+ssh script) makes this much easier ... even trivial.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •