When I've installed
motion in the past it's been done so that it's running as its own designated user, typically
motion. I'd suggest doing the same thing here for your installation as well.
The OP asked how this was done. I explained that if you install the
motion package via either Debian/Ubuntu or Fedodra repos the installation would be done so that everything you needed to run
motion as another user,
motion in my cases, was done out of the box by default.
If you look at the files that would typically get installed with
motion, a SYSV init script is often provided,
/etc/init.d/motion. Within this script, on Ubuntu, is a section like this:
case "$1" in
if check_daemon_enabled ; then
if ! [ -d /var/run/motion ]; then
chown motion:motion /var/run/motion
log_daemon_msg "Starting $DESC" "$NAME"
if start-stop-daemon --start --oknodo --exec $DAEMON -b --chuid motion ; then
If you look at the
start-stop-daemon line you'll notice that when
motion is started (
$DAEMON) the switch
--chuid motion is passed, which will run the
motion daemon process as user
Something similar is done on my Fedora & CentOS systems as well in their corresponding
/etc/init.d scripts for