# allow user1, user2 access user3's crontab with rw permission (crontab -e or -l)
[root@machine sudoers.d]# cat bosops_user
user1  ALL=(user3) NOPASSWD: /usr/bin/crontab 
user2  ALL=(user3) NOPASSWD: /usr/bin/crontab

# allow user3 view user1's crontab

user3 ALL=(user1) NOPASSWD: /usr/bin/crontab -l 



# allow user1 switch to user2 do anything
[root@machine sudoers.d]# cat user1 
user1 ALL=(user2) NOPASSWD: ALL

sudo -u user2 /bin/bash
sudo -u user2 -i


  • No labels
Write a comment…