Thursday, 15 May 2014

linux - Allow only apt-get update and upgrade without password prompt -



linux - Allow only apt-get update and upgrade without password prompt -

i want maintain scheme (and installed packages) "always" on latest version , hence i'm thinking creating special user auto-updates. user cron-job performs "sudo apt-get update -y && sudo apt-get upgrade -y" 1 time week. since should done automatically i'd edit sudoers file (with sudo visudo of course) user never gets password prompt these 2 commands. solution found far disable password prompt apt-get not specific sub commands.

since want maintain safe possible i'd need way allow update & upgrade, no other sub-commands of apt-get. , yes, i'd disable execution of other command via sudo, on safe side.

is there way accomplish or way allow execution of apt-get without password prompts (thus allowing apt-get install)?

i'm using debian based distro raspian.

thanks help!

make script wrapper apt-get update , apt-get upgrade, this:

#!/bin/sh apt-get update $@

and allow in sudoers nopasswd.

but need i'm not sure it's impossible execute shell command using apt-get update or apt-get upgrade, not sure allowing run them root non-root user secure enough.

linux sudo sudoers

No comments:

Post a Comment