Hot answers tagged

4

sudo is a command and it is an executable program. You can find out more about how to use it using these commands in the terminal (in order of least -> most detailed): sudo --help man sudo info sudo To understand more about how it works, you can visit the sudo website where you can browse the source code. You can also download the source code: ...


4

Welcome to Security Whack-A-Mole, the game where you try to enumerate ALL the ways you can get hurt, and try to wrap each one in bubble wrap. You can never win. Rather, learn to use Unix/Linux tools, understand what your system does, and don't run scripts (or anything) you don't understand (that comes from an untrusted-for-system-upgrades source). Your ...


3

The problem on your system is that your umask settings are a bit strange/messed up. For general information about umask please refer to What is "umask" and how does it work? In short we can say that the umask defines the default permission set for new files. It is configured in /etc/login.defs. The default value for umask is 022 which results in ...


3

It is a design feature that since 16.04 you do no longer need root privileges to shut down or reboot the system through any method. Instead the systemd and its systemctl tool accept those commands from regular users. All related commands like shutdown, reboot, halt, poweroff are symbolic links ("symlinks") to /bin/systemctl and init is a symlink to /lib/...


3

You may add your very own User with sudo rights. You can create a User and add this User to the sudo Group. sudo adduser youruser sudo Or if you already have a user, you can add this to the sudo Group. sudo usermod -a -G sudo youruser After this log in to this user with su youruser and try to run the installation again with sudo yourinstallcommand. ...


2

To prevent switching users by sudo su -, you need to disable root's ability to su to any user. Edit /etc/pam.d/su and comment this line: auth sufficient pam_rootok.so As the comment above this in /etc/pam.d/su says, this allows root to su without passwords. Or you could restrict sudo usage to a limited set of commands which don't include su and ...


2

Sometimes running a process from root's crontab may cause issues with initial file ownership and rwx mode; those may not be correctly preserved. In any case: 1) to create a new user, keep it simple: $ sudo deluser my-user # if "my-user" is a regular user $ adduser my-user $ sudo gpasswd -a my-user sudo 2) to include a new entry with a NOPASSWD tag ...


2

Fortunately this question has an answer that works. Using the root account is insecure and I understand that. The accepted answer there is going to help me a lot. Thank you for your suggestions, criticism, and help, bobbyblackblech, Pilot6, Serg, and Parto.


2

(I know I shouldn't comment in an answer, but not enough reputation to comment.) blade19899's answer worked for me except for symlinks. E.g. it applied 755 to /bin/bash, but then applied 777 to the symlink /bin/rbash, effectively 777-ing /bin/bash. As I already had the fileper.log file, I just modified the destination-end command: while IFS=: read -r -d ''...


2

The permissions on your $HOME directory are incorrect. You can fix it by typing chmod u+w $HOME. Notice that the files and directories you created using sudo are probably owned by root now, so, you will need to fix ownership on these. You can do it by using sudo chown logandark.logandark <file or directory name>. EDIT: To change ownership ...


2

Under no circumstances permit your web server to run commands with sudo. Not even hyper-specific commands. This is a huge security risk. A web server should not be given permissions to access sudo commands, which then permit root access for commands. Especially when given nopasswd form of sudo, should your web server be breached, any command run by a ...


1

The principle behind the www-data user is that it is an unprivileged user. When you run a daemon (background program like a web server), for security purposes it is good for it to drop privileges after starting, so that it spends the rest of its time with the lowest privileges possible. In the past the nobody account was often used for this purpose. The ...


1

Of course. I never even have to use "sudo" with using "scp". Mind though: as with all remote copy-ing the servers need to be setup to allow it. You can even use "scp" without having to use a user and without providing a password if you want.


1

I solved this, by using gksudo in desktop files, like this: [Desktop Entry] Type=Application Exec=gksudo /home/kiosk/.config/autostart/serve.sh Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name=Serve I dont know why this worked though, if anyone knows, please tell.


1

The library is available for all Ubuntu versions http://packages.ubuntu.com/search?keywords=commoncpp&searchon=names sudo apt install libcommoncpp2-dev Provides /usr/lib/x86_64-linux-gnu/libccext2.a /usr/lib/x86_64-linux-gnu/libccext2.la /usr/lib/x86_64-linux-gnu/libccext2.so /usr/lib/x86_64-linux-gnu/libccgnu2.a /usr/lib/x86_64-linux-gnu/libccgnu2....


1

Ubuntu comes with sudo by default. sudo is a package/command that allows you to run any command/application as root (sudo stands for SuperUser Do). Your user is by default in sudoers file if you are administrator (who installs the system, per example). Simply type: sudo <command> Example: sudo gedit This runs gedit as root. BE EXTREMELY CAREFUL ...


1

So I have already found the solution: sudo -u test2 bash


1

You might want to think about why the members of the 'client' group can access root privileges in the first place. As far as sudo is concerned, those user's privileges are defined in the sudoers file, that you can edit with visudo (provided you have the neccessary privileges yourself). The sudoers file can be seen as a whitelist: Only those privileges ...


1

If you want to do it in an alias, you have to use alias redo='sudo $(history -p !!)' for some reason.


1

Nice one-liner to remove sudo prompts for the current user sudo bash -c 'echo "$(logname) ALL=(ALL:ALL) NOPASSWD: ALL" | (EDITOR="tee -a" visudo)'



Only top voted, non community-wiki answers of a minimum length are eligible