LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Change username and/or authorization (https://www.linuxquestions.org/questions/linux-newbie-8/change-username-and-or-authorization-4175511528/)

inl1ner 07-18-2014 12:56 PM

Change username and/or authorization
 
hi @ all,

perhaps this is a strange question, because I could find nothing like this in the forum.

My username in linux mint is set up as a administrator. But now I really want to work as a standard user and set up a different user for administration.

When I try to set up an additional user as a administrator, mint does not respond. Click on the Add-button will be ignored without any message.

May I change the permissions for my user to standard and then configure an additional user as a administrator, or have I after this not the authority for configuring a administrator user next?

Regards
inl1ner

suicidaleggroll 07-18-2014 01:05 PM

I suggest you abandon the (in my opinion) horrible way that Ubuntu and Mint handle permissions, and go back to the standard Linux way. No account should be a global "administrator" except for root. In my opinion, the best thing to do would be to enable the root account on your machine, and then strip sudo access for your current "administrator" account to turn it into a regular account.

You can enable the root account by running:
Code:

sudo passwd root
and giving it a password

You can strip sudo access for your current "administrator" account by editing the /etc/sudoers file.

A proper setup means having a root account with a strong password, and then having regular user accounts with [if necessary] limited sudo access to the few commands they need to run on a regular basis that require elevated permissions.

Long answer to a simple question, but it does give you the answer you're looking for. It adds an "administrator" account (root, which should be the only administrator account), and drops your current account to a regular user.

yancek 07-18-2014 01:23 PM

The primary user created during installation with Ubuntu/Mint is the administrator, has root privileges. It would seem to me that it would be simpler to create another regular user and use that. If you are using the GUI Users and Groups from the Control Center or System Settings, you should be prompted for a password when you click Add. If that isn't happening, I don't know what the problem is.

inl1ner 07-18-2014 03:47 PM

@ suicidaleggroll
that seems to me to be an acceptable solution, but how do I edit sudoers?
After I switched on my brain and I typed in "sudo gedit sudoers" I could open the file.
Now I was completely at a loss, because:

# This file MUST be edited with the 'visudo' command as root.
# Please consider adding local content in /etc/sudoers.d/ instead of directly modifying this file.
# See the man page for details on how to write a sudoers file.
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) 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

nothing to me ... sorry ... what am I supposed to change?

If I try it with "visudo sudoers" or "sudo visudo sudoers" appears "usage: visudo [-chqsV] [-f sudoers] [-x file]"
WTF ..
I feel so stupid ...


@yancek
well, is already correct, but accepted my name is yancek and the primary userid is also yancek, I would like to keep this already and do not create another which is my working name then.
How can I solve that?

Anyway, many thanks for your effort!
inl1ner

suicidaleggroll 07-18-2014 04:28 PM

What is the output if you type
Code:

id yancek

inl1ner 07-18-2014 05:00 PM

Hi suicidaleggroll

as you see, my userid is peter. Anyway ...

peter@peter3 ~ $ id peter
uid=1000(peter) gid=1000(peter) Gruppen=1000(peter),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),110(sambashare)

If you like this says something ... wow

I'm going to bed anyway

good night

suicidaleggroll 07-18-2014 05:07 PM

Sorry, you said in your previous post that your name and primary user is yancek.

Anyway, you should be able to drop to a regular user by removing your user account from the "sudo" group. If you notice in your sudoers post above, there's a line that says:
Code:

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

and then in your id post:
Code:

uid=1000(peter, gid=1000(peter) Gruppen=1000(peter)  ...  27(sudo)  ...
You can remove your user from the sudo group a few different ways, described here:
http://unix.stackexchange.com/questi...r-from-a-group
eg:
Code:

gpasswd -d peter sudo

littlejoe5 07-18-2014 05:48 PM

I use LinuxMint all the time for years now. I'm having a little trouble understanding what you mean that your account is strictly administrator. Since I am the only one that uses my computer, I have not investigated that much, but I do not usually work as "administrator" or "root".

I did download and install an OEM version of LinuxMint recently, and thought (from some peculiarities of the install procedure that it might have me as the administrator, but discovered that If I wanted to (for instance) install a program, that I still had to ask for root privileges ("sudo su", or "sudo password command"), so I was not working as administrator. But what I did discover is that the user number was some outlandish figure which I can't remember, so I went through the porcedure to get it ready to "ship to end user" or however it was worded on the icon on the desktop. The different end user number was interfering with me using the files made by myself on other distros for the past ten years.

suicidaleggroll 07-18-2014 05:53 PM

By "administrator" I'm sure he means that his regular user account is allowed to do anything it wants by simply sticking a "sudo" in front of it and typing in his own password. That's not asking for root privileges, that's akin to the Windows security model where you just click "OK" on the popup and it goes on to destroy your system.

When a user is allowed to do anything he feels like by sticking a "sudo" in front of the command, that IS an administrator account.

Disabling the root user and granting this admin ability arbitrarily to the first configured user without any say in the matter is as Windows-like as it gets.


All times are GMT -5. The time now is 09:06 PM.