LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-09-2006, 09:29 PM   #1
nautz
LQ Newbie
 
Registered: Jun 2005
Location: Singapore
Distribution: RedHat ES 3
Posts: 16

Rep: Reputation: 0
Using tar command as non-root user


Hi
I am trying to do a tar command to a magnetic tape drive as a non-root user. However I am getting a Permission denied error. Is there any file which I need to modify in order to allow non-root user to use the tar command? The synthax of the command which I used is as such:

tar -cvf /dev/st0 /opt/logs
 
Old 11-09-2006, 09:53 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
It seems you are trying to make an archive of /dev/st0 and /opt/logs. The only part of the command that is missing is the archive name to create, which should follow immediately after the -f option;

tar -cvf archive.tar /dev/st0 /opt/logs
 
Old 11-09-2006, 11:02 PM   #3
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
This isnt'a distro specific question so I'll throw out a good page I use for help with this kind of stuff, perhpas it'll come in handy for you too.
http://gentoo-wiki.com/HOWTO_File_Compression

I'm sure there are a million sites like though.
 
Old 11-09-2006, 11:57 PM   #4
nautz
LQ Newbie
 
Registered: Jun 2005
Location: Singapore
Distribution: RedHat ES 3
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bigrigdriver
It seems you are trying to make an archive of /dev/st0 and /opt/logs. The only part of the command that is missing is the archive name to create, which should follow immediately after the -f option;

tar -cvf archive.tar /dev/st0 /opt/logs
Hi
/dev/st0 is actually the device file for the magnetic tape drive. So I'm performing a tar command to the magnetic tape drive with the contents of /opt/logs. This is actually working if I were to perform the command as a root user. I am not looking for any synthax errors. The problem arises if I were to perform this command using a non-root user. I would get the permission denied error. So I'm wondering if this has anything to do with tar command or has it anything to do with writing to a device file?

Thanks for the help!
 
Old 11-10-2006, 12:42 AM   #5
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
If you get a permission error, then you need to login as root give the user read permission for the tape drive.

Code:
chmod u+r /dev/st0
 
Old 11-10-2006, 02:46 AM   #6
nautz
LQ Newbie
 
Registered: Jun 2005
Location: Singapore
Distribution: RedHat ES 3
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Penguin of Wonder
If you get a permission error, then you need to login as root give the user read permission for the tape drive.

Code:
chmod u+r /dev/st0
Thanks! I got it! Solve my problem. Really appreciate your help here.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
root user has command start_fish_server b_s Linux - Security 4 06-09-2005 03:28 AM
root permissons to user command line chaitu_iiit Linux - Software 7 11-09-2004 06:54 AM
KDE command work as user, not root. mooreted Slackware 6 04-08-2004 02:21 PM
Need a command so that non-root user can see interfaces that are up/down ming0 Slackware 5 02-02-2004 05:49 PM
changing to root user without command line kaega2 Linux - Software 3 11-28-2003 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration