ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Tracking Down Ubuntu BASH Session Closing

    IT Discussion
    ssh linux openssh ubuntu ubuntu 16.04 ubuntu 18.04 bash shell zsh
    8
    45
    3.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by scottalanmiller

      I have an Ubuntu server (not mine, and it has a GUI installed) that was running 16.04 that we just updated to 18.04. For the most part, everything is running fine. One weird issue is that SSH sessions are closed quickly. I have no idea where it is coming from. I've not found anything oddly configured, yet. Basically you get logged out every fifteen seconds or so, but it does not log you out if some command is running, thankfully. So running an update, or top, you are fine. But seconds after they stop, you are out.

      KeepAlives are on. I can't find any odd time outs. When you sudo to root (aka sudo -i su) it literally types in "exit" and you drop to your user after X seconds. Then as the user, it types "logout" in your session and the session drops.

      JaredBuschJ 1 Reply Last reply Reply Quote 1
      • black3dynamiteB
        black3dynamite
        last edited by

        Hopefully one of these links can help.

        https://www.linuxquestions.org/questions/linux-newbie-8/ssh-session-automatically-closing-698502/

        https://unix.stackexchange.com/questions/166975/ssh-connection-to-server-closed-after-authentication-immediately
        https://unix.stackexchange.com/questions/193044/ssh-connection-to-server-closed-immediately-after-authentication

        1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch @scottalanmiller
          last edited by

          @scottalanmiller said in Tracking Down Ubuntu SSH Session Closing:

          When you sudo to root (aka sudo -i su) it literally types in "exit" and you drop to your user after X seconds. Then as the user, it types "logout" in your session and the session drops.

          have never even heard of something like this.. how the hell would anything type characters into your sessions.

          scottalanmillerS 1 Reply Last reply Reply Quote 0
          • IRJI
            IRJ
            last edited by IRJ

            For CIS compliance they recommend you set under /etc/profile.d/ to set auto logout. Is there anything set there?

            488ba132-8e5d-490f-b459-74b2d18cd3c9-image.png

            scottalanmillerS 2 Replies Last reply Reply Quote 1
            • scottalanmillerS
              scottalanmiller @JaredBusch
              last edited by

              @JaredBusch said in Tracking Down Ubuntu SSH Session Closing:

              @scottalanmiller said in Tracking Down Ubuntu SSH Session Closing:

              When you sudo to root (aka sudo -i su) it literally types in "exit" and you drop to your user after X seconds. Then as the user, it types "logout" in your session and the session drops.

              have never even heard of something like this.. how the hell would anything type characters into your sessions.

              IKR? It's really odd.

              1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @IRJ
                last edited by

                @IRJ what's odd here is that it will time out as you are typing. So it isn't a timeout in the normal sense. You can run a command, and run another say within one second. Literally that fast. And it might kick you in between.

                And when it does, it puts "logout" into the session.

                1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller
                  last edited by

                  Just tested one and I logged in and within two seconds it had logged me out again.

                  dafyreD 1 Reply Last reply Reply Quote 0
                  • dafyreD
                    dafyre @scottalanmiller
                    last edited by

                    @scottalanmiller said in Tracking Down Ubuntu SSH Session Closing:

                    Just tested one and I logged in and within two seconds it had logged me out again.

                    Could it be some strange cron job or something? Or did this start after a system upgrade?

                    scottalanmillerS 1 Reply Last reply Reply Quote 0
                    • IRJI
                      IRJ
                      last edited by

                      Can you scp files?

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • IRJI
                        IRJ
                        last edited by

                        I would try to download some config files so I could look at them

                        1 Reply Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller @IRJ
                          last edited by

                          @IRJ said in Tracking Down Ubuntu SSH Session Closing:

                          Can you scp files?

                          I'm sure that I can. I'll get some.

                          1 Reply Last reply Reply Quote 0
                          • scottalanmillerS
                            scottalanmiller @dafyre
                            last edited by

                            @dafyre said in Tracking Down Ubuntu SSH Session Closing:

                            @scottalanmiller said in Tracking Down Ubuntu SSH Session Closing:

                            Just tested one and I logged in and within two seconds it had logged me out again.

                            Could it be some strange cron job or something? Or did this start after a system upgrade?

                            Could be, definitely. But I looked and haven't found one.

                            1 Reply Last reply Reply Quote 0
                            • scottalanmillerS
                              scottalanmiller
                              last edited by

                              Created a new user from scratch. Same issue just seconds after first login.

                              1 Reply Last reply Reply Quote 0
                              • scottalanmillerS
                                scottalanmiller
                                last edited by

                                I'm pretty sure that it is not SSH related, because sudo sessions get closed, too.

                                1 Reply Last reply Reply Quote 0
                                • scottalanmillerS
                                  scottalanmiller
                                  last edited by

                                  I've switched my shell to zsh and so far, no logouts.

                                  1 Reply Last reply Reply Quote 0
                                  • scottalanmillerS
                                    scottalanmiller
                                    last edited by

                                    If I use zsh, I'm good. If I enter BASH from zsh, I get kicked out after several seconds. Definitely is something to do with BASH.

                                    matteo nunziatiM 1 Reply Last reply Reply Quote 0
                                    • scottalanmillerS
                                      scottalanmiller @IRJ
                                      last edited by

                                      @IRJ TMOUT variable never appears in /etc

                                      1 Reply Last reply Reply Quote 0
                                      • scottalanmillerS
                                        scottalanmiller
                                        last edited by

                                        I manually set the TMOUT variable to 0 to disable it, and it still happens. So that is not what is being used.

                                        1 Reply Last reply Reply Quote 0
                                        • scottalanmillerS
                                          scottalanmiller
                                          last edited by

                                          Tried disabling AppArmor, but that did nothing.

                                          1 Reply Last reply Reply Quote 0
                                          • IRJI
                                            IRJ
                                            last edited by

                                            https://askubuntu.com/questions/404424/how-do-i-restore-bashrc-to-its-default#404428

                                            scottalanmillerS 2 Replies Last reply Reply Quote 1
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post