Tag Info

New answers tagged

3

Can the "foouser" escape to root prompt? Presumably foouser can now open any system binary and "edit" it into something else completely, leaving whatever kind of security hole foouser can dream up. This has particular potential if you do it to a setuid binary, such as passwd, because it means a non-root user could use it do privileged things it was not ...


0

This might works : #!/bin/bash su - user2 -c 'echo "$0" "$@"' -- "$@" Use simple quotes ' to pass the command argument to su so you don't have to escape the double quotes ". References : Escaping bash function arguments for use by su -c - Stack Overflow bash - Passing arguments to su-provided shell - Unix & Linux Stack Exchange


-1

Follow these steps: ~# chmod 440 /etc/sudoers ~# chmod -R 755 /root ~# chmod -R 755 /etc ~# chmod 755 /etc/phpmyadmin/config.inc.php


1

Ultimately, Debian's (and therefore Ubuntu's) adduser calls gpasswd: my $gpasswd = &which('gpasswd'); &systemcall($gpasswd, '-a',$existing_user,$existing_group); Debian's adduser was written with the purpose of being a convenient frontend to a range of utilities (it makes use of, at one step or another, useradd, gpasswd, ...


0

Ok, I worked out that even though I was setting gksu to use sudo for authentication, this was all irrelevant as the shortcuts that I was using in the Xfce menu were starting applications using polkit and not gksu. From the Gentoo Wiki on polkit, I did: sudo bash -c "cat > /etc/polkit-1/rules.d/10-admin.rules" <<EOL ...


0

You're on the right track, just the wrong command. Try: Enable sudo by installing app-admin/sudo....Done Configure sudo using visudo. Set the appropriate options .... Hopefully Done Use gksudo app-name instead of gksu app-name. In gentoo, gksudo is part of the package x11-libs/gksu, and the actual man page is at gksudo man page. As always make sure ...


1

gksu acts like su, not sudo. That's why it asks you root password. Try to run gksudo instead if available. If not, you can run gksu --sudo-mode. Also, from the man page: Also notice that the library will decide if it should use su or sudo as backend using the /apps/gksu/sudo-mode gconf key, if you call the gksu command. You can force the backend by ...


2

dd if=boot1h of="/dev/r$temp1" status=none The status= flag controls which info to suppress outputting to stderr; 'noxfer' suppresses transfer stats, 'none' suppresses all dd (coreutils) 8.21


0

from the sshd manpage: If ~/.ssh/rc exists and the sshd_config(5) PermitUserRC option is set, runs it; else if /etc/ssh/sshrc exists, runs it; otherwise runs xauth. The “rc” files are given the X11 authentication protocol and cookie in standard input. See SSHRC, below.


0

Sudoers file won't work like that, or so it seems to me. Sudoers file is intended to give a specific command access, not to the specify the arguments that can go with that command. Create a script that runs as root and executes this: /usr/bin/systemctl start database@ Make the script take an argument such as anotherawesomeapp so it executes this: ...


1

I see you've tagged your question osx so if you've done this on a mac, make use of the GUI. Open any Finder window and press cmd shift G Type /etc/sudoers and press return to go to the file Press cmd i with the file highlighted Scroll to the bottom of that info window to 'Sharing & Permissions` and click the lock icon in the bottom right Type an admin ...


1

I asked the same question in sudo mailing list, and the answer: Currently you can only set the real and effective gids. There is no way to set the group vector.


0

You should never attempt to edit /etc/sudoers directly. The command visudo is designed to check the format and make sure you don't end up in a situation like this one. Unfortunately, you now have a borked sudoers file which won't let you run commands with sudo so you can't fix it. If you have enabled the root account, log in as root and run visudo. If you ...


3

The reason this is failing is that, by default, ssh does not create a terminal (a pty) on the target machine. This means that su cannot prompt for a password, so it fails. (sudo would also fail to prompt, for the same reason, unless given the -S flag - as pointed out by @Scott.) You can tell ssh to create a terminal (pty) on the remote system, so that su ...


0

Is it possible to use sudo before the command you want to execute? Like instead of: su whatever command do: sudo whatever command


1

.bashrc is executed only by interactive shells, not by scripts¹. It's the wrong place to define environment variables. See Alternative to .bashrc and the Ubuntu wiki. You can tell bash to read .bashrc explicitly. Of course you'll have to execute bash, not sh which could be a different shell: sudo -i -u username bash -c '. `~/.bashrc; echo "$MY_ENV"' But ...


0

I wouldn't give root access nor physical access to anyone I wouldn't trust with my life. This is an exceedingly bad idea, but unfortunately the OP never responded to the WHY?! or the What do they need to do exactly? which in my humble opinion were excellent requests for clarification. Be that as it may, If I were to consider such a course of action rather ...


0

If you have any other root/admin user than 'fsolano', that is not in the sudoers file. This incident will be reported: check sudo enabled users (groups) # getent group sudo sudo:x:27:xyz,abc since the user 'fsolano' is changed to standard user and if you have any other root privileged user, login via the root one and change 'fsolano' to administrator ...


0

Running the following commands: gksu nautilus sudo rm /etc/apt/sources.list.d/getdeb.list.bck you can remove that file. Here you can find some more explanation about the solution procedure.


7

The way to add a directory to sudo's PATH (which, as you found out is not the same as root's), is to edit the sudoers file: sudo visudo Then, find this line: Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" And add your directory to the end of it: Defaults ...


1

In addition to /etc/sudoers, sudo will also read files in the /etc/sudoers.d directory. The cloud-init application, commonly used on AWS instances, places a sudoers configuration in that directory for allowing the default user to sudo without a password.


2

RESTRICT The way I interpret "restricting users to the set of programs that do not [allow shell escapes] is often unworkable", it means that it is so common for programs that, on the surface, seem to perform a single, safe task, but actually allow one to run any other program, that one should assume, in the general case, that giving a user access to a ...


0

It fails, because sudo is trying to prompt on root password and there is no pseudo-tty allocated. You've to either log-in as root or set-up the following rules in your /etc/sudoers (or: sudo visudo): # Members of the admin group may gain root privileges. %admin ALL=(ALL) NOPASSWD:ALL Then make sure that your Jenkins user belongs to admin group (or ...



Top 50 recent answers are included