Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running on Ubuntu server as root user (according to whoami).

I'm trying to untar a package. Unfortunately the untarred folder and all files are somehow owned by another user (zabbix).

I did install zabbix recently but I am logged in as root so I expect the untarred files to be owened by root. What am I doing wrong?

share|improve this question
up vote 3 down vote accepted

tar encodes the numeric id of the owner and primary group of every file. When you untar a tarball all the owners will be set back to their original numeric id's, for example uid 500. What you have is the zabbix user in your system created as uid 500. Hence, when you restore the archive, the files appear to be owned by zabbix.

To confirm, try

id zabbix and ls -aln $DIRECTORY

My guess is they will be the same.

share|improve this answer

Add the --no-same-owner parameter to your command (assuming a gnu tar). When running as root, tar automatically preservers file ownership and permissions.

As an aside: Are you sure you really need to be doing whatever you're doing as root?

share|improve this answer
do you mean that the tar i'm untarring was tarred by owner zabbix? it is the latest distribution of memcached so it does not make sense to me. – Niro Feb 24 '10 at 8:05
@Niro No, the tar wasn't tarred by owner zabbix. It was probably tarred by a user with with the same user id as the user zabbix has on your system. Since uids aren't universally unique, this can easily happen. – Tim Seguine Jul 9 '15 at 12:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.