Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9093255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:03:12+00:00 2026-06-16T23:03:12+00:00

One of the task that my python script does is to extract an entire

  • 0

One of the task that my python script does is to extract an entire Linux Root FS tarball and then copy files from it into a destination directory. While doing so, I am getting the error in case of special restricted files (like gshadow) as follow:

File "script.py", line 553, in copy_rootfs
shutil.copy(sourceFileName,targetFileName)
File "/usr/lib/python2.6/shutil.py", line 88, in copy
copyfile(src, dst)
File "/usr/lib/python2.6/shutil.py", line 52, in copyfile
fsrc = open(src, 'rb')
IOError: [Errno 13] Permission denied: '/home/myuser/temp/home/embeduser/NFS/LinuxFS/etc/gshadow'

Permissions for the file gshadow extracted from tarball is as follow:

myuser@host temp]$ ls -l home/embeduser/NFS/LinuxFS/etc/gshadow 
---------- 1 myuser myuser 271 Nov  5 08:54 home/embeduser/NFS/LinuxFS/etc/gshadow 

Is there a way I can achieve this without having to run my python script as root?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:03:13+00:00Added an answer on June 16, 2026 at 11:03 pm

    You can’t do it with shutil, but it’s easy enough to come up with some custom solution. The trick is that gshadow has no permissions, but belongs to the local user. So you can change its permissions with os.chmod(), read it, then (if necessary) change the permissions back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a quick one off task in a python script that I'd like
I am writing a shell script that will perform 2 tasks. One task will
I have some python scripts that configure linux computers. One of the tasks is
I have a Python script that does something along the line of: def MyScript(input_filename1,
Just stumbled upon propertyGrid and its awesome! However, i have one task that i
I have a table of 3-4 columns, the central one being task names that
My goal is to have an AsyncTask that can execute multiple times (one task
I have a function that performs a monthly task on one or more specified
Is it possible to change the name(the one that apears under 'processes' in Task
I am interested in running a very long running rake task, one that would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.