I read  explaining that "sometimes" root can own something at /home/$USER directory.  Can anyone give an example how to prove it. Just give a test case when something really bad happens, when I run  sudo gedit /etc/rc.local   edit file and save.  I got many downvotes  out and comments flooded in saying that it is a crime to run gedit with sudo.  Can anyone give a real example?  I clearly explained why this question is not a duplicate. There is no answer specific to gedit to the linked question.  And it is important to explain why widely used sudo gedit is bad, or not really, etc.
6272
I've read  and am interested in this line:     You should never use normal sudo to start graphical applications as Root.   Why? What is the difference? Please provide a simple explanation, as I'm just a normal desktop user.
1809
In /etc/sudoers I see this:  # Allow members of group sudo to execute any command after they have # provided their password # (Note that later entries override this, so you might need to move # it further down) %sudo ALL=(ALL) ALL   So how do I add a user to that sudo group?
67372
Why  do we use sudo to perform a terminal command as an administrative? Why isn't it  admin or something else? Is there a reason for sudo?
115350
What would happen if I ran sudo -rm -rf /* --no-preserve-root in the bash shell that you can enable on windows  proof of shell:
48235
I am writing a script (actually a combination of scripts and makefile) that installs external dependencies: some apt-get commands, some git cloning, building, installing, adding users to groups, ...  Some of the operations in these scripts require superuser permissions, some don't.   Until now I have run the entire make process with sudo, but it has some drawbacks:   git repos I clone get root as owner, which means I can't modify them afterwards without sudo or chown the scripts that add users to groups don't know which user to add since whoami returns root   What is the best way of running as superuser only the commands that require it? Ideally the process would still require me to enter my sudo password, but only once at the very beginning of the install process. It would then forget it at the very end, but keep it all the time until then (it can take several hours).  The solutions I have found online include:   sudo -v at the begninning of the script, but if I understand correctly this times out. My script could be running for a couple of hours running the script with sudo, but the commands that do not need superuser with sudo -u $(logname) &lt;command&gt;. This is what I do now, but it feels like it should be the other way around.   Ideally, I would like my script to:   ask for superuser credentials run normal commands as the logged in user run sudo commands with the credentials entered at step 1 sudo -k to close the superuser session
25959
For example, I'm trying to run Archive Manager from Ubuntu Desktop (10.04) under sudo otherwise it won't let me extract a Software Development Kit into /usr/local  Update: I don't want sudo to be a permanent change to launching the application; only to run it under sudo when I choose, until it's quit.
96339
When I run sudo gedit /path/to/some/random/file I get the following error    ** (gedit:6262): WARNING **: Command line `dbus-launch --autolaunch=7f8731869e1c690b8205727e0000000a --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed. Cannot open display:  Run 'gedit --help' to see a full list of available command line options.     Using gksudo doesn't help either which returns    Cannot open display:  Run 'gedit --help' to see a full list of available command line options.     Any help guys. I need to have this capability to open files in Gedit as root. I found this question with the same error but no solution     EDIT I found this post in . These are the instructions:     echo $DISPLAY # you'll be needing this value 3 lines below sudo -i # or "su -" on older Slackwares xauth merge ~alien/.Xauthority # use your own username here instead of "alien" export DISPLAY=:0.0 # use the value of DISPLAY you've seen 3 lines before     On coming to command #3, I got this error xauth:  file /root/.Xauthority does not exist    Maybe this new info can shed more light.
69386
When using sudo powers and calling gedit the top level menu with File Edit View Search Tools Documents Help is missing.  If I create user ID root and sign in once and call gedit will it create the necessary user configuration files that might fix this?  Will this also make the annoying error messages go away whenever I use sudo, gksu or pkexec as a regular user with elevated privileges togedit ?  Will there be other benefits with Nautilus and other Gnome derivative Ubuntu applications?  NOTE: by sudo powers you can google pkexec gedit 3.5k hits, gksu gedit 40k hits or sudo gedit 500k hits. I'm in the minority using the first method but I believe it will become the standard in Ubuntu 17.04.    June 12, 2017 Update Here are a list of errors you get when using pkexec gedit:  (gedit:13003): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files  ** (gedit:13003): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-spell-enabled not supported  ** (gedit:13003): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported  ** (gedit:13003): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-position not supported   On this  there is a commitment to fix these distracting messages as of June 5, 2017. No indication is given for when the fix will be upstream nor if the functionality will be implemented or the error messages will simply disappear.  Note the bug report was filed over a year ago and over that time it only effects 18 people.
22828
I have run the following commands:   sudo groupadd -r testgroup sudo useradd -g testgroup -M -r testuser   Notice the -r option, which according to the man page:     -r   &nbsp;&nbsp;&nbsp;&nbsp;Create a system account.   Assuming I have a user account with root privileges, I then run:  sudo -u testuser cat /dev/input/mouse0   However, I get:     cat: /dev/input/mouse0: Permission denied   Running the same command as root provides the expected output (garbled output from the mouse driver).  How can I create a user with root privileges?
56278
When I am working on our RHEL machines, I use sudo su - to switch to being root. One day, a typo meant I typed sudo su -- instead - it seems to me that everything was the same as with a single hyphen, except that I was in the same folder as before I issued the command (with a single hyphen I find myself in /root).  Are there other differences? Is it safe to use this in scenarios where I know I want to work in the same directory?
81024
I have the following file:  ---------- 1 Steve Steve 341 2017-12-21 01:51 myFile.txt   I switched the user to root in the terminal, and I have noticed the following behaviors:   I can read this file and write to it. I can't execute this file. If I set the x bit in the user permissions (---x------) or the group permissions (------x---) or the others permissions (---------x) of the file, then I would be able to execute this file.   Can anyone explain to me or point me to a tutorial that explains all of the rules that apply when the root user is dealing with files and directories?
94240
Whenever I open the terminal,   To run a command as administrator (user "root"), use "sudo &lt;command&gt;".   See "man sudo_root" for details.   appears before the terminal. How do I get that to go away?
86082
I've often come across posts on forums or other websites where you see people joking in such a manner about running/logging in as root as if it's something awful and everyone ought to know about it. However, there isn't much that a search reveals on the matter. It maybe widely known to Linux experts, but I really don't know why. I remember always running as root when I first tried Linux years ago (Redhat and Mandrake) and don't remember running into any problems because of that. There are actually some distros that have a bright red background with alert signs all over it as wallpaper for the root user (Suse?). I still use the "Administrator" account for regular use on my Windows installation and haven't ever run into any problems either.
49065
When I run sudo, what exactly happens to my environment?  When I run sudo command, it doesn't seem to see my or root's environment. For example, my path for both includes /usr/local/bin, but if I try to run one of the program's without the full path, it fails.  I thought sudo ran as root, and hence got root`s environment. Is there a different way that bash executes under sudo than under root or my normal user?  EDIT:  I have been using sudo -i lately, but recently it has been causing problems because my current working directory gets set to /root. This is as expected (sorta), but I still don't understand why sudo isn't recognizing my executables in /usr/local/bin.  EDIT:  I am running Fedora 15.
7493
I don't care if I mess up the system (which is likely if I do things like this), or the potential security issues that this could imply. Note, that I don't just want to "", but run my GUI from bottom-up as root. I don't want to type my password for anything but just for login and have total control over it.  Of course, I want any application running as root, like Firefox, LibreOffice, etc. without having to mess up with the terminal. So, how do I do this?     This question tries to address users that do not like the current permission system with root being separated from normal users. I do not endorse such behaviors, but if a user wants to, for whatever reason, this question should fit their corncerns.   Not advisable for new users
30210
If I have two users called john and sally. Both are part of the users group. john creates a directory with permissions 775. sally then puts a file there with 644 permissions.  Even though the file obviously has no group write privileges. Can john then modify/delete that file in the directory he owns but the file he does not own?
18751
For instance, if I were to run the command adduser test, is the .bashrc created automatically upon creation of the home directory for the user test? If it's not created upon user creation, under what conditions is it created?  Also, if I add a .bashrc file to the home directory of a user, will it be overwritten by the OS?  Thanks in advance.