We help IT Professionals succeed at work.
Get Started

User and group on files un-tarred

Anony Mous
Anony Mous asked
on
228 Views
Last Modified: 2015-03-22
All,

I ssh'd into a server as myself and created a directory called "misc" (for example) in /usr/local/share like this:

sudo mkdir /usr/local/share/misc

Then i cd'd to the /usr/local/share/misc, then i copied a tar file from another directory to the /usr/local/share/misc directory i created.

I then ran sudo tar -xvf mytarfile.tar because the permissions on the tar file were root::root, which extracted all the files in the /usr/local/share/misc.

My question is this, why when i un-tarred the files using sudo, in the directory i created with sudo, was the ownership of every file set to user as "jsmith" (just an example of another user on the system) , and the group was set to "users"?

Why weren't all the files set to root::root or myuserid:myuserid? We are both in sudoers with the same privileges.

Thanks, this one is stumping me.
Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2007
Commented:
This problem has been solved!
Unlock 3 Answers and 8 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE