All Questions
34 questions
7
votes
3
answers
2k
views
Security implications of increasing sudo timeout in terminal
I often need to run commands with sudo during development and since my password is lengthy I don't like to type it every time sudo times out which by default is 5 minutes.
To deal with that I've run ...
1
vote
1
answer
459
views
Security difference between changing permissions versus using sudo to execute
If there is a program written by a normal user that requires root privileges (eg. a program that interacts with root processes) what is the difference between running this program using sudo vs. ...
1
vote
0
answers
986
views
Using GPG from another user (GNU/Linux)
I want to use gpg from another user (user2), so that the primary user (user1) does not have access to the encrypted file, but only to the part the script will output.
Added a sudo rule for user1 to ...
2
votes
1
answer
254
views
Why is sudo's usage of timestamp files insecure?
Sudo and Opendoas on Linux use timestamp files to keep track of how long it's been since you've last entered your password. Doas on BSD uses a kernel feature instead.
Why is the latter considered more ...
0
votes
2
answers
258
views
Disable everything but a hidden command for root access
linux security and root access question....
I'm setting up a server that has a validator node running on it for a blockchain. I was trying to harden the security of my server. I set up ufw for all ...
0
votes
2
answers
304
views
How `sudo` command checks password?
To check the sudo password, we need root permission to even read the /etc/shadow file. But how sudo checks password?
1
vote
1
answer
1k
views
Java application run as root
I'm testing Linux server where Java web application is run as root, I typed:
>ps aux
in the result I see:
root 18265 (...) Sl+ 19:52 0:37 java -Xmx2g -jar test_app.jar
what is the best ...
4
votes
3
answers
2k
views
On a single user laptop does it make sense to have a separte password for root and the user?
I have a laptop on which I'm the only user. While installing the laptop I was wondering why I should choose a different password for the root account and user account. My reasoning is:
The change of ...
1
vote
0
answers
52
views
Why does sudo remove environment variables by default? [duplicate]
The sudo command has the -E option that allows users to pass through all environment variables, although it's still subject to the security policy configuration. So, is the use of -E inherently unsafe?...
0
votes
0
answers
178
views
Reverse sudo - sudo ro untrusted user
I want to split my terminal sessions to different users, to compartmentalize them.
If I sudo -i -u user1 in one terminal window,
can user1 attack my main session?
Everyone talks about sudo to escalate ...
1
vote
1
answer
404
views
Properly granting restrictive administrative privileges to developers on a production server [closed]
I am a business owner with a strong technical background, say a programmer, though not an advanced system administrator. I've bought a VPS server where I want to host several applications and webpages....
0
votes
2
answers
2k
views
Exectuting sudo command in one line within a non-tty shell
I have access to a server via RCE over http. I can send post requests to the server which results in command execution. I am attempting to escalate privileges via sudo (su is not installed).
The ...
5
votes
1
answer
266
views
Is explicitly disabling a default in the sudoers file the same as not listing it at all?
I'm reviewing the /etc/sudoers file on a machine in response to CVE-2019-18634, a buffer-overflow vulnerability present in sudo. The bulletin on the sudo.ws website recommends the following mitigation:...
12
votes
5
answers
1k
views
How can one tell if a binary is safe to give sudo permissions for to an untrusted user?
sudo is sometimes used to give untrusted or "semi-trusted" users the ability to perform certain tasks as root, while not giving them unlimited root access. This is usually done via an entry into /etc/...
1
vote
2
answers
626
views
sudo whitelist just program perl
In visudo Ubuntu I whitelist this program
myuser ALL=(root) NOPASSWD:/myuser/program.pl
when I run
sudo /myuser/program.pl
I get prompt to set password. The solution is to add to visudo /usr/bin/...
4
votes
1
answer
487
views
How can a bad process obtain root by waiting for a user to run a command as sudo?
A comment on this answer states:
The whole linux desktop provides very little protection against bad processes running as the user. A bad process could just watch the keyboard input and wait for ...
1
vote
1
answer
467
views
Using SUID program to avoid having entries in sudoers
Well, I've done a lot of reading and documentation around possible exploitation of sudoers files and SUID programs, but don't have a deep enough knowledge to pick up the wisest possible solution for ...
5
votes
1
answer
715
views
Is it safe to use a unix pipe to redirect sensitive output data as input to another program?
I want to make a Node.js development server use HTTPS by giving it access to the contents of a TLS certificate and private key file.
On the one hand, I don't like the idea of making the TLS private ...
3
votes
2
answers
618
views
Which Linux commands can execute user-supplied code? [closed]
As explained here (https://www.helpnetsecurity.com/2014/06/27/exploiting-wildcards-on-linux/), the tar command can be used to execute arbitrary code.
Is there a list of Linux commands, preferably ...
1
vote
1
answer
1k
views
What can an attacker do in this scenario? (unwritable bashrc, profile, etc.) [closed]
Scenario:
Typical Linux desktop setup: unprivileged user but with sudo capabilities to do basically everything
For the sake of argument let's forget about X11 and its way to allow trivial keyloggers, ...
8
votes
2
answers
3k
views
Do sudo and .profile/.bashrc enable trivial privilege escalation?
First of all, let me mention that I’m assuming a configuration as set up by current Linux desktop distributions (e. g. Debian, Fedora). I’m sure that there are methods which, if implemented, would ...
-1
votes
2
answers
237
views
Is it dangerous to turn on internet connection under su -c?
If someone would turn on internet connection using command su -c "/sbin/ifup ppp1" would it put system at risk (how bad) ?
5
votes
1
answer
604
views
How to properly protect /home with separate user accounts on Linux
A great quote from this InfoSec stackExchange thread.
The way to prevent malicious code from damaging files in your home
directory is to not run it using your account. Create a separate_user
...
101
votes
13
answers
15k
views
Why is root security enforced but $HOME typically unprotected?
Coming from the comments in this question Why is it bad to log in as root?:
The sudo mechanics is in use so non-administrative tools "cannot harm your system." I agree that it would be pretty bad if ...
10
votes
3
answers
14k
views
What does this sudo -l output mean and can this be priv. escalated?
I am trying to do priviledge escalation of a linux box.
My sudo -l output shows the following :
www-data@box:/scripts$ sudo -l
sudo -l
Matching Defaults entries for www-data on box:
env_reset, ...
1
vote
1
answer
412
views
What is a safe way to exit a user's shell?
If I change to a potentially compromised user in Unix, for example by using su or sudo -i, then exit with exit, the compromised user could alias exit to something which drops me into a fake shell ...
2
votes
1
answer
459
views
sudo -u <user> <cmd> vs sudoedit
I have read on the internet that you have to use sudoedit instead of sudo vim. I understand why this is and should be used so you can't just edit root-user files.
However I would like to manage a ...
4
votes
1
answer
11k
views
Security implications of using SETCAP CAP_NET_RAW
In order to get around the 'problem' of applications requiring root privileges to run, I'm using:
sudo setcap CAP_NET_ADMIN+ep "$(readlink -f /usr/sbin/app)"
sudo setcap CAP_NET_RAW+ep "$(readlink -f ...
27
votes
6
answers
8k
views
Why is it considered safe to install something as a non-root user in Linux environments?
We always hear it is safe to run unknown programs as non-root users in Linux because non-root users are sandboxed from the system level and can't change anything out of their permission scope. If ...
31
votes
5
answers
11k
views
Why should one use sudo? [duplicate]
Most modern Linux articles advice using sudo rather than logging into root. This advice is so ingrained, some distros don't automatically allow root login. Indeed they come pre-configured with sudo ...
8
votes
4
answers
3k
views
Does the new Fedora package manager allow unauthorized installations?
I just upgraded to Fedora 22. The biggest change from the previous version is that the yum package manager is now replaced with dnf. One change I've noticed is that if you try to execute a command ...
5
votes
2
answers
2k
views
What are the security risks in leaving 'sudo' inside my production code?
I have a script that can only run successfully with root permissions
But in development it's really hard to run with root permissions (in my development environment) so I add 'sudo' when ever it's ...
6
votes
3
answers
8k
views
What are the risks of making ether-wake available to all users?
The Linux ether-wake utility, which creates a magic packet to wake on lan another machine, requires root access:
$ether-wake 12:34:56:78:9A:BC
ether-wake: This program must be run as root.
To give ...
4
votes
2
answers
3k
views
Do `sudo` and `su` belong to capability-based security?
In Linux, do sudo and su belong to Capability-based security ?
For example, when editing a system file, we usually need sudo or su to temporarily switch to user root. Does this example belong to ...