Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 27752  / 1 Year ago, wed, march 29, 2023, 12:15:44

I'm using Ubuntu 10.04 LTS server, with the default security model (root locked, using sudo to elevate privileges). I occasionally enjoy using sudo -i when I'll need to run a series of commands with elevated privileges, or when I need to rummage around in directories with root-only privileges.



Sometimes, when setting up software that'll run as its own non-privileged system account (adduser --system --group --no-create-home --disabled-login some-daemon-user) I find that I need to run a sequence of commands as that user, rather than myself or root. I've tried using sudo -i -u some-daemon-user, but it just returns a 1 status without any error message.



I've checked the syslog, messages, auth, and debug log files in /var/log and none of them include any messages that reference sudo or the account in question.



So, is it possible to become another non-root user, sudo-style without just setting a password and logging in (as them)? Is my system 'broken' in some way or am I just doing it wrong?


More From » sudo

 Answers
0

Ahmm.. the problem is that the standard shell of those users is normally set to /bin/false and for security reasons you should not change this. But you can still run for example: sudo -u www-data /bin/sh


[#34625] Wednesday, March 29, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
defendle

Total Points: 219
Total Questions: 131
Total Answers: 112

Location: Finland
Member since Sat, Nov 6, 2021
3 Years ago
defendle questions
Mon, May 10, 21, 03:46, 3 Years ago
Mon, Dec 5, 22, 07:16, 1 Year ago
;