Announcement

Collapse
No announcement yet.

change root user / accounts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    change root user / accounts

    so in my scenario , i had my 1 account setup (root) , but my kids was getting more and more on my pc and doing whatever they do
    so i was starting to get worried that they could install/delete stuff ,cause login password is the same as root password on admin account.
    PS: i did 1st create 2 new user accounts for them (standard user) , but then found everything they are used to is gone ( they're used to log into my account with everything set up)
    so what i did it is create another sysadmin account and then made my usual account standard ,so they can log into my usual account and everything seems like they used to by now, but they cant "change" anything.
    if any1 find them self's in the same situation , here are the steps:

    basically it goes like this
    -Keep your current account (xxx) exactly as it is.
    -Create a new account called sysadmin (or similar) and add it to sudo.
    -Remove xxx from the sudo group.

    like this :
    Create the new admin account
    Code:
    sudo adduser sysadmin
    You'll be asked to set a password for sysadmin.​

    Add sysadmin to the sudo group
    Code:
    sudo usermod -aG sudo sysadmin
    .

    Test the new account

    Before removing xxx from sudo, log out and log into sysadmin.
    Open a terminal and run:
    Code:
    sudo whoami
    It should return:
    root
    If it does, you're good.

    Remove xxx from the sudo group
    Log back into sysadmin (important!), then run:
    Code:
    sudo deluser xxx sudo
    Verify:
    Code:
    groups xxx
    You should no longer see sudo in the list.

    Test xxx
    Log back into your normal xxx account and try:
    Code:
    sudo apt update
    You should get:
    xxx is not in the sudoers file. ( or in my case sudo: I'm sorry xxx. I'm afraid I can't do that)

    and that's that ...

    IMPORTANT :
    Whenever you need to do admin tasks
    Code:
    su - sysadmin
    hope this helps someone with kiddies on their PC


    PS : if there is an alternative way , i'd love to hear (read) it



    Last edited by die.boer; Yesterday, 01:56 PM.
    ʟɨռʊӼ ʄօʀ ʟɨʄɛ

    #2
    Well, at a minimum this is very non-standard and I read though it a couple times and really not clear on the reasons or purpose for everything.

    So you want your kids to be able to use your account because they are used to the way it's setup, but you're concerned they'll figure out how to "sudo" and wreak havoc on your system? Is that right?

    Also, normally (whatever that is) there is no password assigned to the root account unless you did that. The default is to have an admin account belong to the sudo group - period. Safer this way.

    I see a few alternatives:
    1. Create a new account "kids" (or in my case "little monsters" ).
    2. Duplicate your current /home/ folder and over-write the one created for "kids".
    3. Change the file:group ownership in "/home/kids" to "kids:kids".
    or
    1. Let them use your account, but remove your user from admin and sudo groups
    2. Create a new account for yourself
    3. Repeat above steps to duplicate home, etc.
    or
    1. Remove your user account from sudo and admin
    2. Create/use a root password to log into the terminal to do updates and installs/removes, etc.

    Please Read Me

    Comment


      #3
      there is no password assigned to the root account unless you did that.
      i'm sure when i installed and created a single user and created a login password for said user , there was a checkbox "use same password for root" , or something to that effect , i can't remember .

      My kids already knew my login password because they had been using my account for months. Since a sudo-enabled account uses the same password for authentication, I wanted to prevent accidental or intentional system changes without having to recreate their entire environment in separate accounts.

      Creating a dedicated sysadmin account and removing my daily account from the sudo group solved that problem nicely. It may not be the most common home setup, but it achieves exactly what I wanted: the familiar desktop remains unchanged, while administrative privileges are separated behind a password only I know.

      Copying my home directory to a separate "kids" account would also work, but maintaining multiple Plasma profiles wasn't something I wanted to do.


      ​Also , IMO , from a security perspective, it's better than having an administrator account permanently logged in all day.

      ʟɨռʊӼ ʄօʀ ʟɨʄɛ

      Comment


        #4
        as i do all updates whatever with cli , there is now 1 extra step to do when wanna update , namely su - admin

        jp@jp:~$ sudo nala update && sudo nala full-upgrade && sudo snap refresh && [ -f /var/run/reboot-required ] && echo ">>> Reboot recommended <
        <<"
        sudo: I'm sorry jp. I'm afraid I can't do that
        1 jp@jp:~$ su - admin
        Password:
        admin@jp:~$ sudo nala update && sudo nala full-upgrade && sudo snap refresh && [ -f /var/run/reboot-required ] && echo ">>> Reboot recommende
        d <<<"
        [sudo: authenticate] Password:
        Updated: http://security.ubuntu.com/ubuntu resolute-security InRelease [137 KB]
        No Change: http://archive.ubuntu.com/ubuntu resolute InRelease
        Updated: http://archive.ubuntu.com/ubuntu resolute-updates InRelease [137 KB]
        Updated: http://security.ubuntu.com/ubuntu resolute-security/main amd64 Packages [341 KB]
        Updated: http://security.ubuntu.com/ubuntu resolute-security/main i386 Packages [158 KB]
        Updated: http://security.ubuntu.com/ubuntu resolute-security/main Translation-en [87 KB]
        Updated: http://security.ubuntu.com/ubuntu resolute-security/main amd64 Components [33 KB]
        Updated: http://security.ubuntu.com/ubuntu resolute-security/restricted amd64 Packages [288 KB]
        Updated: http://security.ubuntu.com/ubuntu resolute-security/restricted Translation-en [56 KB]
        Updated: http://security.ubuntu.com/ubuntu resolute-security/universe i386 Packages [83 KB]
        Updated: http://security.ubuntu.com/ubuntu resolute-security/universe amd64 Packages [150 KB]
        Updated: http://security.ubuntu.com/ubuntu resolute-security/universe amd64 Components [43 KB]
        No Change: http://archive.ubuntu.com/ubuntu resolute-backports InRelease
        Updated: http://archive.ubuntu.com/ubuntu resolute-updates/main i386 Packages [182 KB]
        Updated: http://archive.ubuntu.com/ubuntu resolute-updates/main amd64 Packages [402 KB]
        Updated: http://archive.ubuntu.com/ubuntu resolute-updates/main amd64 Components [62 KB]
        Updated: http://archive.ubuntu.com/ubuntu resolute-updates/universe i386 Packages [108 KB]
        Updated: http://archive.ubuntu.com/ubuntu resolute-updates/universe amd64 Packages [223 KB]
        Updated: http://archive.ubuntu.com/ubuntu resolute-updates/universe amd64 Components [153 KB]
        Updated: https://dl.google.com/linux/chrome-stable/deb stable InRelease [3 KB]
        Updated: https://dl.google.com/linux/chrome-stable/deb stable/main amd64 Packages [1 KB]
        Fetched 2.6 MB in 3s (882.3 KB/s)
        18 packages can be upgraded. Run 'nala list --upgradable' to see them.
        No Change: http://security.ubuntu.com/ubuntu resolute-security InRelease
        No Change: http://archive.ubuntu.com/ubuntu resolute InRelease
        No Change: http://archive.ubuntu.com/ubuntu resolute-updates InRelease
        No Change: https://dl.google.com/linux/chrome-stable/deb stable InRelease
        No Change: http://archive.ubuntu.com/ubuntu resolute-backports InRelease
        Fetched 0 Bytes in 1s (0 bytes/s)
        ================================================== ================================================== =========================================
        Upgrading
        ================================================== ================================================== =========================================
        Package: Old Version: New Version: Size:
        libldb2 2:2.11.0+samba4.23.6+dfsg-1ub 2:2.11.0+samba4.23.6+dfsg-1ub 150 KB
        untu2.1 untu2.2
        libsmbclient0 2:4.23.6+dfsg-1ubuntu2.1 2:4.23.6+dfsg-1ubuntu2.2 64 KB
        libtalloc2 2:2.4.3+samba4.23.6+dfsg-1ubu 2:2.4.3+samba4.23.6+dfsg-1ubu 51 KB
        ntu2.1 ntu2.2
        libtdb1 2:1.4.14+samba4.23.6+dfsg-1ub 2:1.4.14+samba4.23.6+dfsg-1ub 70 KB
        untu2.1 untu2.2
        libtevent0t64 2:0.17.1+samba4.23.6+dfsg-1ub 2:0.17.1+samba4.23.6+dfsg-1ub 42 KB
        untu2.1 untu2.2
        libwbclient0 2:4.23.6+dfsg-1ubuntu2.1 2:4.23.6+dfsg-1ubuntu2.2 58 KB
        python3-ldb 2:2.11.0+samba4.23.6+dfsg-1ub 2:2.11.0+samba4.23.6+dfsg-1ub 42 KB
        untu2.1 untu2.2
        python3-samba 2:4.23.6+dfsg-1ubuntu2.1 2:4.23.6+dfsg-1ubuntu2.2 3.2 MB
        python3-talloc 2:2.4.3+samba4.23.6+dfsg-1ubu 2:2.4.3+samba4.23.6+dfsg-1ubu 14 KB
        ntu2.1 ntu2.2
        python3-tdb 2:1.4.14+samba4.23.6+dfsg-1ub 2:1.4.14+samba4.23.6+dfsg-1ub 17 KB
        untu2.1 untu2.2
        samba-common 2:4.23.6+dfsg-1ubuntu2.1 2:4.23.6+dfsg-1ubuntu2.2 48 KB
        samba-common-bin 2:4.23.6+dfsg-1ubuntu2.1 2:4.23.6+dfsg-1ubuntu2.2 1.4 MB
        samba-libs 2:4.23.6+dfsg-1ubuntu2.1 2:4.23.6+dfsg-1ubuntu2.2 6.6 MB
        smbclient 2:4.23.6+dfsg-1ubuntu2.1 2:4.23.6+dfsg-1ubuntu2.2 480 KB
        tdb-tools 2:1.4.14+samba4.23.6+dfsg-1ub 2:1.4.14+samba4.23.6+dfsg-1ub 28 KB
        untu2.1 untu2.2

        ================================================== ================================================== =========================================
        Kept Back, Will Not Be Upgraded
        ================================================== ================================================== =========================================
        Package: Old Version: New Version: Size:
        python3-software-properties 0.120 0.120.1 133 KB
        software-properties-common 0.120 0.120.1 197 KB
        software-properties-qt 0.120 0.120.1 166 KB

        ================================================== ================================================== =========================================
        Summary
        ================================================== ================================================== =========================================
        Upgrade 15 Packages
        Kept Back 3 Packages

        Total download size 12.4 MB

        Do you want to continue? [Y/n]
        ╭─ Downloading… ────────────────────────────────────────────────── ────────────────────────────────────────────────── ────────────────────────╮
        Total Packages: 15/15
        Last Completed: samba-libs_2%3a4.23.6+dfsg-1ubuntu2.2_amd64.deb
        Time Remaining: 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━100.0%12.4/12.4 MB8.4 MB/s
        ╰───────────────────────────────────────────────── ────────────────────────────────────────────────── ────────────────────────────────────────╯
        Unpacking: libtalloc2:amd64 (2:2.4.3+samba4.23.6+dfsg-1ubuntu2.2) over (2:2.4.3+samba4.23.6+dfsg-1ubuntu2.1)
        Unpacking: libtevent0t64:amd64 (2:0.17.1+samba4.23.6+dfsg-1ubuntu2.2) over (2:0.17.1+samba4.23.6+dfsg-1ubuntu2.1)
        Unpacking: libsmbclient0:amd64 (2:4.23.6+dfsg-1ubuntu2.2) over (2:4.23.6+dfsg-1ubuntu2.1)
        Unpacking: samba-common (2:4.23.6+dfsg-1ubuntu2.2) over (2:4.23.6+dfsg-1ubuntu2.1)
        Unpacking: smbclient (2:4.23.6+dfsg-1ubuntu2.2) over (2:4.23.6+dfsg-1ubuntu2.1)
        Unpacking: libtdb1:amd64 (2:1.4.14+samba4.23.6+dfsg-1ubuntu2.2) over (2:1.4.14+samba4.23.6+dfsg-1ubuntu2.1)
        Unpacking: libwbclient0:amd64 (2:4.23.6+dfsg-1ubuntu2.2) over (2:4.23.6+dfsg-1ubuntu2.1)
        Unpacking: python3-samba (2:4.23.6+dfsg-1ubuntu2.2) over (2:4.23.6+dfsg-1ubuntu2.1)
        Unpacking: samba-common-bin (2:4.23.6+dfsg-1ubuntu2.2) over (2:4.23.6+dfsg-1ubuntu2.1)
        Unpacking: python3-ldb (2:2.11.0+samba4.23.6+dfsg-1ubuntu2.2) over (2:2.11.0+samba4.23.6+dfsg-1ubuntu2.1)
        Unpacking: libldb2:amd64 (2:2.11.0+samba4.23.6+dfsg-1ubuntu2.2) over (2:2.11.0+samba4.23.6+dfsg-1ubuntu2.1)
        Unpacking: samba-libs:amd64 (2:4.23.6+dfsg-1ubuntu2.2) over (2:4.23.6+dfsg-1ubuntu2.1)
        Unpacking: python3-tdb (2:1.4.14+samba4.23.6+dfsg-1ubuntu2.2) over (2:1.4.14+samba4.23.6+dfsg-1ubuntu2.1)
        Unpacking: python3-talloc:amd64 (2:2.4.3+samba4.23.6+dfsg-1ubuntu2.2) over (2:2.4.3+samba4.23.6+dfsg-1ubuntu2.1)
        Unpacking: tdb-tools (2:1.4.14+samba4.23.6+dfsg-1ubuntu2.2) over (2:1.4.14+samba4.23.6+dfsg-1ubuntu2.1)
        Setting up: libtdb1:amd64 (2:1.4.14+samba4.23.6+dfsg-1ubuntu2.2)
        Setting up: samba-common (2:4.23.6+dfsg-1ubuntu2.2)
        Setting up: libwbclient0:amd64 (2:4.23.6+dfsg-1ubuntu2.2)
        Setting up: libtalloc2:amd64 (2:2.4.3+samba4.23.6+dfsg-1ubuntu2.2)
        Setting up: python3-tdb (2:1.4.14+samba4.23.6+dfsg-1ubuntu2.2)
        Setting up: tdb-tools (2:1.4.14+samba4.23.6+dfsg-1ubuntu2.2)
        update-alternatives: using /usr/bin/tdbbackup.tdbtools to provide /usr/bin/tdbbackup (tdbbackup) in auto mode
        Setting up: libtevent0t64:amd64 (2:0.17.1+samba4.23.6+dfsg-1ubuntu2.2)
        Setting up: python3-talloc:amd64 (2:2.4.3+samba4.23.6+dfsg-1ubuntu2.2)
        Setting up: libldb2:amd64 (2:2.11.0+samba4.23.6+dfsg-1ubuntu2.2)
        Setting up: samba-libs:amd64 (2:4.23.6+dfsg-1ubuntu2.2)
        Setting up: python3-ldb (2:2.11.0+samba4.23.6+dfsg-1ubuntu2.2)
        Setting up: samba-common-bin (2:4.23.6+dfsg-1ubuntu2.2)
        Setting up: libsmbclient0:amd64 (2:4.23.6+dfsg-1ubuntu2.2)
        Setting up: python3-samba (2:4.23.6+dfsg-1ubuntu2.2)
        Setting up: smbclient (2:4.23.6+dfsg-1ubuntu2.2)
        Processing: triggers for man-db (2.13.1-1build1)
        Processing: triggers for libc-bin (2.43-2ubuntu2.3)
        ╭───────────────────────────────────────────────── ────────────────────────────────────────────────── ────────────────────────────────────────╮
        │✔Running dpkg …━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━100.0% 0:00:00 31/31
        ╰───────────────────────────────────────────────── ────────────────────────────────────────────────── ────────────────────────────────────────╯
        Finished Successfully
        All snaps up to date.
        admin@jp:~$ exit
        logout
        1 jp@jp:~$ exit


        ʟɨռʊӼ ʄօʀ ʟɨʄɛ

        Comment

        Users Viewing This Topic

        Collapse

        There are 0 users viewing this topic.

        Working...
        X