2
1
I want to be able to run commands as root... How do i do this?
sudo yum install @kde-desktop
cromwell is not in the sudoers file. This incident will be reported.
I found a post saying to edit /etc/pam.d/gdm
but there are several variants (gdm-password
, gdm-pin
, etc) and i dont really want to go out on a limb.
This is the first question i have, with my first time running Fedora I am very pleased that it comes with the up to date software i am looking for. Any and all help getting past this simple problem would be greatly appreciated.
How do i make the sudo
command work in fedora 20? (I do not want to log in as root, simply run the commands as root)
EDIT
the following is a copy-paste from my bash prompt:
[root@localhost /]# sudo adduser cromwell sudo
Usage: adduser [options] LOGIN
adduser -D
adduser -D [options]
Options:
-b, --base-dir BASE_DIR base directory for the home directory of the
.............
-Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
[root@localhost /]#
EDIT 2
I tried the following command, as instructed here:
sudo usermod -aG sudo cromwell
it then says: group 'sudo' does not exist
i then enter sudo usermod -aG
and press tab a few times...
output
abrt chrony ftp halt
nobody root tss adm
colord games lp openvpn rtkit unbound avahi cromwell
gdm mail operator
shutdown usbmuxd avahi-autoipd daemon
geoclue mysql polkitd sshd
bin dbus gnome-initial-setup nm-openconnect pulse sync
i then ran the following command sudo usermod -aG adm cromwell
and it ran with no error... i did a full reboot, and once logged back in i ran sudo mkdir
~/test`... then low and behold i get the same error about the sudoers list =(
(it may be worth noting that i did manage to install kde by logging in as root, therefore i am currently using KDE as my desktop. but still.... how do i use sudo?)
EDIT SHOULD I ADD MY USER TO THE root
GROUP?
(EDIT- i am told here to NOT do this, as it will result in massive security issues)
EDIT
the first option of the accepted answer was what worked. THE SECOND OPTION DID NOT. This should be noted here, or the second option deleted
=========================================
Note, if this is off topic for super user (or not within the expertise of this website) please let me know, and i will personally flag it for migration. Thank you.
after using the above command, it provided usage documentation. I logged out and back in. It still gives the same warning when attempting to use the
sudo
command as the usercromwell
. Are you 100% positive that this is the correct format for the command? The usage saysadduser [option] login
... this says it would beadduser sudo cromwell
, but i dont want to add sudo to the group cromwell by misunderstanding the usage page. Thoughts? ---EDIT: Rebooting to see if it helps – Konner Rasmussen – 2014-04-18T19:38:01.803no dice =( I dont get it... Other resources say to do this very same thing. I can use
su
to log in as root, and successfully run the following commandsudo mkdir /home/cromwell/sudo-test
but all adduser gives me is a usage page, and apparently doesnt do what its supposed to... – Konner Rasmussen – 2014-04-18T19:47:18.2301@KonnerRasmussen I added to my answer. I hope it helps! – bitsmack – 2014-04-18T20:13:08.960
i dont have a sudo group in fedora 20... so i used adm (which should have su privilages) still nothing... see the second edit on the question – Konner Rasmussen – 2014-04-18T20:20:13.203
should i add my user to the
root
group? – Konner Rasmussen – 2014-04-18T20:40:18.2601@KonnerRasmussen There, I gave another update. Hopefully this works! No, you don't want to be a root member, it makes the system susceptible to errors and exploits... – bitsmack – 2014-04-18T20:42:53.590
The first option worked, thank you =) (i did have trouble figuring out the difference between insert and command mode) – Konner Rasmussen – 2014-04-18T21:04:04.023
1@KonnerRasmussen Excellent! Glad it's working. As far as insert and command modes, it sounds like your default text editor is vi or vim. They're powerful and old-school, and pretty arcane at times :) There are different editors, if you prefer. If you search for editor recommendations, prepare for heated discussion! Take care. – bitsmack – 2014-04-18T21:11:43.070