Skip to content

Instantly share code, notes, and snippets.

@dionysius
Last active April 14, 2016 14:38
Show Gist options
  • Save dionysius/f13af82952b9a08dd618bb8d2c3d7c9a to your computer and use it in GitHub Desktop.
Save dionysius/f13af82952b9a08dd618bb8d2c3d7c9a to your computer and use it in GitHub Desktop.
Fix AMPPS users and groups ids. Tested for elementaryOS freya, but should work with most ubuntu derivates.

Fix AMPPS users and groups (ampps,mysql) ids

The linux edition of ampps setups users & groups with id > 1000, but I'd like to have them < 1000 so they're considered as system users.

  • Change in /etc/group and /etc/passwd the ids of these groups to the next free numbers

/etc/group before:

[...]
___other___:x:126:dionysius
ampps:x:1001:
mysql:x:1002:

/etc/group after:

[...]
___other___:x:126:dionysius
ampps:x:127:
mysql:x:128:

/etc/passwd before:

[...]
___other___:x:117:126:___other___:/var/lib/___other___:/bin/false
ampps:x:118:127::/home/ampps:
mysql:x:119:128::/home/mysql:

/etc/passwd after:

[...]
___other___:x:117:126:___other___:/var/lib/___other___:/bin/false
ampps:x:118:127::/home/ampps:
mysql:x:119:128::/home/mysql:
  • The command id should now show the new ids of these users and groups
$ id ampps
uid=118(ampps) gid=127(ampps) groups=127(ampps)

$ id mysql
uid=119(mysql) gid=128(mysql) groups=128(mysql)
  • Change the existing permissions to the new ids:
$ sudo chown -R --from=1001 ampps:ampps /usr/local/ampps/
$ sudo chown -R --from=1002 mysql:mysql /usr/local/ampps/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment