New answers tagged

0

Running sudo is a bad idea because you don't know what will happen and if it's really necessary: Will a password prompt be shown? If so, who is going to type a password? Remember: your script may be run in a shell by a human, but could also be run in background, at startup, by cron or in other situations where a terminal is not available. Will the user ...


2

You forgot to state that it is a command alias: Cmnd_Alias REMOUNT = /bin/mount -o remount\,rw /,/bin/mount -o remount\,ro /


4

Your output shows that sync-samuel issues a sudo prompt, even though you run it without sudo and the script itself doesn’t invoke sudo.  This doesn’t make any sense.  It looks like, when you type sync-samuel, you’re running something other than the sync-samuel script that you show in the question. It is possible that sync-samuel is actually an alias for ...


3

sudo works with binaries only but not for shell command structures. You have to run the whole thing with sudo. It doesn't make much sense to call sudo several times within a loop. It may cache the password, though. sudo bash -c 'for logf in /var/log/apt/history.log.?.gz; do zcat "$logf"; done'


0

Given the information we learned in the comments, it appears that: you ran some command with sudo (perhaps to edit sudoers to add the quoted NOPASSWD line in the Q) sudo cached those credentials, allowing you to run a reboot or shutdown within timestamp_timeout (5 minutes by default, I believe) but after the reboot (more than timestamp_timeout), you were ...


0

To solve this I followed below steps: go to home directory by running command "cd -" then type 'su -' it will ask you for password then type your login password you will be in root user. [shri@localhost ~]$ su - Password: [root@localhost ~]# vi /etc/sudoers then add "username ALL=(ALL) ALL" to sudosers save and exit


0

Edit /etc/sudoers You need to add the following command user host = (root) NOPASSWD: /sbin/shutdown user host = (root) NOPASSWD: /sbin/reboot


1

At the risk of trying to read Todd Miller's mind, I'll just say that sudo is configured to report the hostname in the logging it does, so it has to look it up. See the log_denial function at: https://www.sudo.ws/repos/sudo/file/f19c689a2ded/plugins/sudoers/logging.c


3

On UNIX-like systems, sudo is typically configured to log to a text file. For example, on Red Hat Enterprise Linux systems that is usually /var/log/secure, but it may be configured differently on your system. You should consult your system's man pages for information on how it is configured in your environment. Once you've confirmed your system's ...


0

From my research I believe I know the answer - this is impossible to achieve. Sudo is a command line only and cannot be invoked from GUI. This answer does not explain the nature of what's happening because honestly I don't understand the details, but I made peace with the fact that it's not achievable.


0

When you're doing groups, you need to have two backslashes. This tells Linux/sudo that you're escaping a backslash, otherwise, it treats it as something else. %domain\\group ALL=(ALL) ALL


1

You need to add yourself to the wheel group: sudo usermod -a -G wheel $LOGNAME Then GUI would ask for your password, not the root's one.


0

It looks like you screwed up the PATH setting (used to locate programs). Try e.g. sudo /usr/bin/vi ... (i.e., give full path to executables). You can also try to login as root directly, or su into the account.


4

PermitRootLogin No doesn't prevent root logins entirely, it only prevents root logins through ssh. Enabling this option prevents a class of brute force attacks where an attacker tries to ssh root@server with some common passwords (including an empty password, which can work if PermitEmptyPasswords is enabled). The point of refusing remote root logins is that ...


0

setuid: (set user ID upon execution) is a Unix/Linux access rights flag that allow users to run an executable with the permissions of the executable's owner. It is needed for tasks that require higher privileges than those which common users have, such as changing their login password. suid: (saved user ID) is used when a program running with elevated ...


0

"set user ID" is an important permission feature. sudo and su (and many other programs including mount) need this feature to work; some programs work partly without this feature (like mount), others (like sudo and su) do not work at all. This feature is related to files. Files exist in file systems only. nosuid disables this feature for all files in a file ...


3

Press CTRL+D to exit out of the password prompt. CTRL+C also works, but which one or if both works might depend on your system.


2

Being unable to change permissions as root on a built-in application or system file on OS X is indicative of System Integrity Protection, a new security feature added in 10.11, which restricts the root account and limits the actions that the root user can perform on protected parts of OS X. Protected parts include /System and pre-installed ...


-2

You should be able to achieve your desired results as the root user on Mac OS X prior to 10.11 "El Capitan". "The user account named "root" is a special user in UNIX-style operating systems that has read and write privileges to all areas of the file system." If you have not already enabled the root user, here are the instructions on how to enable ...


1

On a technical level, there's no way to tell that the string a program is requesting will be used as a password. On the other hand, there are kdesu and gksudo which are, to a first approximation, "sudo but with a popup window for the password".


2

I think you should be fine. What you've done is drop symlinks for items in /opt/rh/devtoolset-2/root/usr/bin/ into /usr/local/bin/(the location of custom binaries). This is most likely in your PATH variable as well and is most likely prioritized higher (in case you wanted to override something manually). sudo, however, is usually located at /usr/bin/sudo. ...


9

The two processes are sudo on the one hand, and cp on the other. When you run sudo cp source destination & the shell starts sudo with the full command line; then sudo (which runs as root because it is setuid root) checks that you're allowed to run cp like that, and forks and starts cp. So while cp is running you see both sudo and cp processes.


1

It accesses the Documents/Images of the user you run it as (if they exist - if that user has no home, then it may not work, browsers usually store some data in home, such as the profiles and stuff). Otherwise, the answer is yes. No regular user can (as per usual permissions on home folders) access homes of any other users, or change system files. The ...



Top 50 recent answers are included