Solved

Can I extract a tar as special user?

Posted on 2008-10-17
4
308 Views
Last Modified: 2013-12-16
My special username is:
user123

My special password is:
password123

This is how I extract files from a tar:
tar xf tar.tar

When I am logged in as "foo" how can I extract the files from a tar as user123 so they are owned by user123?

0
Comment
Question by:hankknight
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
zerodollars earned 250 total points
ID: 22743541
use the 'su' command.

type 'man su' to get the help manual up and it will give you all the available info on it.
0
 
LVL 9

Assisted Solution

by:michofreiha
michofreiha earned 250 total points
ID: 22743627
use sudo su and extract the file
0
 
LVL 16

Author Comment

by:hankknight
ID: 22743816
Could you please be more specific?

I am doing this from PHP so I have only one line to do it in:

<?php  shell_exec('tar xf tar.tar'); ?>
0
 
LVL 16

Author Comment

by:hankknight
ID: 22744053
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
awk sed 8 63
Upgrade BIOS / EUFI at Scale 4 55
Remove Resilio directory from Netgear ReadyNAS 212 via SSH. 2 47
Disabling security updates Ubuntu 3 25
Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question