[[+content_image]]
D
D
David It2022-04-14 11:56:54
linux
David It, 2022-04-14 11:56:54

How to allow hepldesk user to run command as backup user?

the task is this:
Allow the helpdesk1 user to run the newbackup command as the backup user.

newbackup is an alias command, I wrote it like this:

[[email protected] Загрузки]$ cat ~/.bashrc
# .bashrc
...
# Custom aliases
alias newbackup='bash /home/user/bash-script10'


and added this to visudo:
helpdesk1       ALL=(ALL)       /usr/bin/passwd, !/usr/bin/passwd sysadmin, !/usr/bin/passwd root, /home/user/.bashrc backup1

How do I try to run the command:

[[email protected] ~]$ sudo -H -u root -c 'newbackup'

How do I set permissions correctly?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
P
pfg21, 2022-04-14
@David138

the command
bash /home/user/bash-script10 is not added to visudo,
which you actually run.
if the command line is not in the sudoers records, then naturally it does not work.
alias newbackup is "unwrapped" by bash and a line without alias goes to sudo.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question