If I issue a   sudo /bin/bash`   [sudo] password for mark: cmp -bl /dev/blah1 /dev/blah2   and using   sudo cmp -bl /dev/blah1 /dev/blah2   then logging in as root?  I don't see whats different, if issuing multiple command lines then rooting IMHO seems the logical option over typing sudo prefix to command lines.  I have seen sudo -i being used to log in to root, that used to work but the last week its issuing an error.  ** EDIT **  I logged in as root, issued the command  mark@mark-zotac:~$ sudo cmp -bl /dev/sda "/media/mark/Seagate Expansion Drive/SSD/ssd.img" [sudo] password for mark:  mark@mark-zotac:~$   It ran, took about 30 minutes to run but produced zero as in nothing output. I am left with no indication of failure or success... So how do I know if the compare result was a success?
93843
My question is asking regarding a specific observation that I would like to understand.   I just tried to install the package rJava in R and failed even though I prefaced the installation as suggested  with:  sudo R CMD javareconf   Then I came across :     Using sudo and running as root are not exactly the same thing. –  Jon7   Desparate as I was I tried it:  sudo su R CMD javareconf   And to my surprise I suddenly could install that package.    Sorry for the lenghty introduction but I wanted to give you a context to prevent answers like . The question does not aim at specifically the described observation - rather at those "things" in general on Ubuntu.  My question is: How could this be possible? What is the difference between sudo X and runnding X as root?
87180
Currently, for all my commands that require root access, I have to type them out on a command line.  I would like for the GUI to prompt me to key in my password, when sudo is required, instead of having to type out the commands from command line.  Is there any way to enable this? Previously one version of Ubuntu desktop had this feature out of the box.  This version of Ubuntu (that I am now running) I upgraded from a server installation.  I will add, my user account is already added to sudo group. Thus I can run commands such as sudo gedit or sudo apt-get but I'm not able to install software in the Ubuntu Software Center.
7868
Let's say I have a file called run.sh that contains:  #! /bin/sh -x  x-www-browser index.html   And ls -l run.sh says:  -rwxr-xr-x 1 myusername myusername 39 Jan  9 19:32 run.sh   And ./run.sh says:  bash: ./run.sh: Permission denied   Why does it not work? Why does sh -x run.sh work perfectly?    More info, since it's not so easy apparently  If I do a sudo, it will not output an error, but won't do anything either.  myusername@crunchbang:/mnt/data$ sudo ./run.sh [sudo] password for myusername:  myusername@crunchbang:/mnt/data$
6139
What is the default password of the sudo? I visit some forums, it tells that the default password is password, but it doesn't work, how can I determine the password?
377
I need to reset my password. I have followed these steps:    However, then I go to "root" or "netroot" recovery options, it tells me:  Give root password for maintenance (or type Control-D to continue)   Clearly, I do not know the root password. If I type CTRL+D, I return to the list of options. From  I read:  Under chapter 'The Other Way':  4. Highlight the line that begins kernel and press 'e' to edit`   But in the grub configuration file I have no line that starts with kernel. Only:  setparams 'Ubuntu...' recordfail set gxfpayload... insmod part_msdos insmod ext2 set root=... search --no-floppy... linux /boot/vmlinuz-2.6.38... initrd /boot/initrd.img-2.6....   Those are all lines in my GRUB. Which line should I edit? Or is there another way to reset my password?
6240
I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to.  The trouble is, this contrived example doesn't work:  sudo ls -hal /root/ &gt; /root/test.out   I just receive the response:  -bash: /root/test.out: Permission denied   How can I get this to work?
2104
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 may be 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 there either.
89624
I've been reading . Apparently I would gain root access if I hold down enter (somewhere) for 70 seconds. I tried it on a password prompt but it gave me like 3 attempts and stopped. I tried it on a tty but it didn't work also. Am I not vulnerable or am I doing it wrong?
112957
The Linux desktop can perform several actions which is otherwise not available to the user when logged in from a terminal. Actions such as system shutdown, and changing system time are accessible only to a sudo user after entering the password. How does this work. Is there a root daemon running which takes command from the login user. Please guide me to the right answer.  I am running Ubuntu 13.10.
105861
On a colleagues computer, everytime I use a sudo command, I get this error:  sudo: must be setuid root  I tried various things mentioned on the internet, like changing the permissions to 4755 from a live cd, but even this command from a live-cd   sudo chmod 4755 /media/device/usr/bin/sudo  gives the same error.  EDIT: The colleague told me that he executed this command, god knows why :/  sudo chmod -R 777 / or sudo chmod -R 777 He isnt exactly sure.
95791
Is there some way I can run a Bash script as root without being prompted for a password every time? I'm attempting to automate the process of starting my LAMPP install, which requires me running a couple of sudo commands to start and stop services. Optimally, I'd like to build this into an executable file, so all I'd have to do is click an icon. ;)  Obviously, I have the password, so that's not an issue. I just want to take my laziness one step farther and not have to enter it every time I start my localhost. After all, that's what programming is all about, right?
36380
On busy days, I'd like to run   $ ./configure &amp;&amp; make &amp;&amp; sudo make install &amp;&amp; halt   on the night and go to bed, hoping the application would automatically be installed. But what I see the next day is the screen where sudo asks me for the password. So how could I run sudo with password in one command line, or is there any other method to do this?
7971
I installed  (Precise Pangolin), 64 bit. Nowhere was I asked to set password for root.  I just installed  software. It was installed under the /root folder by default. Now I try do something on that folder. I tried with su to switch to root, but I don't know its password.   Should I always use sudo or get the default root password, if any?  How do I create a  for software installed inside the /root directory?
123757
I have a script run from a non-privileged users' crontab that invokes some commands using sudo. Except it doesn't. The script runs fine but the sudo'ed commands silently fail.   The script runs perfectly from a shell as the user in question. Sudo does not require a password. The user in question has (root) NOPASSWD: ALL access granted in /etc/sudoers. Cron is running and executing the script. Adding a simple date &gt; /tmp/log produces output at the right time. It's not a permissions problem. Again the script does get executed, just not the sudo'ed commands. It's not a path problem. Running env from inside the script being run shows the correct $PATH variable that includes the path to sudo. Running it using a full path doesn't help. The command being executed is being given the full path name. Trying to capture the output of the sudo command including STDERR doesn't show anything useful. Adding sudo echo test 2&gt;&amp;1 &gt; /tmp/log to the script produces a blank log. The sudo binary itself executes fine and recognizes that it has permissions even when run from cron inside the script. Adding sudo -l &gt; /tmp/log to the script produces the output:       User ec2-user may run the following commands on this host:   (root) NOPASSWD: ALL    Examining the exit code of the command using $? shows it is returning an error (exit code: 1), but no error seems to be produced. A command as simple as /usr/bin/sudo /bin/echo test returns the same error code.  What else could be going on?  This is a recently created virtual machine running the latest Amazon Linux AMI. The crontab belongs to the user ec2-user and the sudoers file is the distribution default.
19160
Knowing that giving a user a sudo's grace period right from the point when he/she login might be a security issue, I still think it will be a beneficial trade-off between security and usability in my setup.  The question is: how to do that? As far as I know, the sudo doesn't provide CLI for it.  I might somehow divert the gdm's typed password to something like sudo false, but again: how to get hold of the provided by the user password in the plain text? Should I write a custom pam module for it?  Or maybe it is better to immerse into implementation details of the sudo and as a root directly manipulate the timestamp database?
78799
I find that if I execute something using sudo that then if I execute something else soon after also using sudo, that it does not prompt me for my password, and although this can be inconvenient in some situations, it is a security risk in others, and a hassle to keep on coming back and executing the command to make it prompt your for the password on the next go. So I was wondering if and how I could get it to prompt me every time, or for it to at least only remember my password for a very short amount of time?
71407
I know what the man page has to say about the -K and -k :     ‑K       The ‑K (sure kill) option is like ‑k except that it removes the user's   cached credentials entirely and may not be used in conjunction with a   command or other option. This option does not require a password. Not   all security policies support credential caching.      ‑k[command]       When used alone, the ‑k (kill) option to sudo invalidates the user's   cached credentials. The next time sudo is run a password will be   required. This option does not require a password and was added to   allow a user to revoke sudo permissions from a .logout file. Not all   security policies support credential caching. When used in conjunction   with a command or an option that may require a password, the ‑k option   will cause sudo to ignore the user's cached credentials. As a result,   sudo will prompt for a password (if one is required by the security   policy) and will not update the user's cached credentials.   So if there is no need to use a command in conjunction with these options, am i correct in assuming K is always the better option to use rather that k?