Announcement

Collapse
No announcement yet.

Automating login

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Automating login

    Hello,
    Under Kubuntu 20.04, defining my own user-id as having admin capabilities and also specifying "automatic login" worked as I intended it to work. In 20.10 I did the same. But, when opening a new konsole window/sub-window on the same monitor screen for the same user, I have to enter my password every time. This becomes cumbersome after a while. Am I missing something?
    H. Stoellinger

    #2
    What are you referring to with 'your own user id'? You have a second account? The account created during the OS install automatically has sudo admin permissions already, and needs nothing extra done.

    Do you have to enter a password immediately when opening a new terminal instance, or only when doing something requiring admin privileges (ie using sudo).

    That is actually the expected behavior. A new konsole window or tab is a brand new session, and requires the password when using sudo. Sudo privileges do stick around in a session for 15 mins or something like that, so one does not have to constantly enter a password when doing multiple tasks. But a new terminal window opening with admin privileges granted is a massive security risk, akin to being logged in to the desktop as root.

    Comment


      #3
      See https://www.kubuntuforums.net/showth...l=1#post424454 and specifically post #14 (?) by Oshunluvr.
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        Originally posted by hstoellinger View Post
        ... when opening a new konsole window/sub-window on the same monitor screen for the same user, I have to enter my password every time
        It shouldn't do that, automatic login or not.

        Is the password prompt inside the konsole window, or in a GUI popup?

        I suggest checking your login scripts (.bashrc, .profile, and maybe .login) for commands that need privileges to run.
        Regards, John Little

        Comment


          #5
          The password prompt is inside the konsole window. there is NO .login file. ~/.profile includes ~/.bashrc. But - I don't see anything within them that might suggest the necessity of special privileges to run.

          Comment


            #6
            After entering the password, what does the terminal show?

            Mine shows my username and computer name:
            Code:
            claydoh@claydoh-Pavilion590:~$
            Is yours any different in format than the above?


            Something to look at:
            Settings >> Edit Current Profile
            And see what the 'Command' box shows. It should be simply /bin/bash
            If yours is any different, tell us what it shows.

            Click image for larger version

Name:	Screenshot_20201030_153739.jpg
Views:	1
Size:	85.1 KB
ID:	644907

            It is also possible that you have multiple profiles, and you can see them from the settings menu, under 'Manage Profiles", switching to a different one may get you the expected results.

            Comment


              #7
              Hello again!
              My shell prompt after entering the password is: "2020-11-01 11:37:57-hs@hslaptop:~$" (basically the same as yours, except that I added date and time through PS1...
              The prompt for the password surprises me: It is "
              [sudo] password for hs:" (in my case in German!).
              Looking at the profile...
              There is only one profile. The command-box shows ONLY /bin/bash. As far as I can make out, there is nothing "weird" about the profile (128 chars/line, 40 lines, Linux colors, copy line on select,...).

              Comment


                #8
                Originally posted by hstoellinger View Post
                But, when opening a new konsole window/sub-window on the same monitor screen for the same user, I have to enter my password every time.
                To be clear, are you saying that: 1) You have enabled Automatic Login so that you are not prompted for your password at the Greeter screen, and 2) You are prompted for your password when you launch a Konsole session?

                If the latter is 'yes', was this behavior experienced 'always', or did it 'start happening' at some point?

                If 'yes' to the latter, had you launched Konsole (from Krunner?) 'as root'?

                Have you checked for any 'root owned' files in your users home directory?
                Windows no longer obstructs my view.
                Using Kubuntu Linux since March 23, 2007.
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  (1) At system install I defined "automatic login" for the user specified then, so as not have to login every time
                  when booting. This works as intended!

                  (2) Yes.
                  If at all, it may have happened after some sw-upgrade through apt-get a couple of days ago, but I don't really
                  remember exactly. On Kubuntu 20.04 (multi-boot install on the same laptop) I do NOT have to enter a password -
                  except when working with files (e.g. like fstab) that require sudo. I have compared the sudo-related files in /etc
                  and can't see any differences.

                  cat /etc/group shows the adm-group members like this:
                  adm:4:syslog,hs,netdata

                  By the way - my sudoers file is defined like this:
                  ------------------------
                  #...
                  Defaults env_reset,timestamp_timeout=1200
                  Defaults mail_badpass
                  Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
                  Defaults log_host, log_year, logfile="/var/log/sudo.log"
                  Defaults log_input, log_output
                  Defaults badpass_message="Falsches Password"

                  # Host alias specification

                  # User alias specification

                  # Cmnd alias specification

                  # User privilege specification
                  root ALL=(ALL:ALL) ALL
                  hs ALL=(ALL) NOPASSWD: ALL

                  # Members of the admin group may gain root privileges
                  %admin ALL=(ALL) NOPASSWD: ALL

                  # Allow members of group sudo to execute any command
                  %sudo ALL=(ALL:ALL) ALL

                  # See sudoers(5) for more information on "#include" directives:

                  #includedir /etc/sudoers.d
                  ------------------
                  There also is a file /etc/sudo.conf, but everything therein is commented out. Under Kubuntu 20.04
                  there is NO such file!

                  I NEVER started Konsole from Krunner, but always from the task-bar at the bottom of the screen.
                  What might have been the consequences had I done so?

                  Are there any 'root-owned' files in my home directory?
                  - "ls -la" for directory "/home/hs" (the directory for the user defined at sysgen) displays the following:
                  drwxr-xr-x 32 hs hs 4096 Nov 1 12:34 .
                  At THAT level all directories/files are owned by hs:hs

                  And - the following bash command (in some variations) doesn't show any directories/files
                  NOT owned by my own user:
                  find ~ -type d ! -user hs -exec find {} -maxdepth 3 ! -user hs \;
                  or
                  find ~ -type d -user hs -exec find {} -maxdepth 3 ! -user hs \;

                  - Directory "/home":
                  lrwxrwxrwx 1 root root 44 Okt 25 18:46 .directory -> /etc/kubuntu-default-settings/directory-home


                  Looked at it some more. The prompt for the login when starting konsole the first
                  time after boot (and again for any NEW sub-window) looks like this:

                  [sudo] Passwort für hs:

                  I wonder why it has "sudo" in front of it. The profile specifies
                  "/bin/bash" under command (not sudo su, or su -).
                  Then - "
                  pstree -als $$" shows this:
                  systemd splash
                  └─plasmashell
                  └─konsole -qwindowtitle Konsole -qwindowicon utilities-terminal -e /usr/bin/konsole
                  └─konsole
                  └─bash
                  └─pstree -als 23675

                  By the way - I can cancel the login-prompt for the password by simply pressing Ctrl-c. It then displays the normal prompt and puts me into my home directory.
                  It is all a bit weird - at least to me!
                  Regards
                  Last edited by hstoellinger; Nov 15, 2020, 04:34 AM. Reason: new data

                  Comment

                  Working...
                  X