hi all,<\/p>\n
so im running a simple tar command to tar a dir but that dir the user:group is owned by the user “bitwarden” and im tar’ing it under the user root but it works as i imagine root can do it even when it doesnt own it<\/p>\n
thanks,
\nrob<\/p>","upvoteCount":2,"answerCount":7,"datePublished":"2024-11-01T11:16:30.711Z","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"},"suggestedAnswer":[{"@type":"Answer","text":"
hi all,<\/p>\n
so im running a simple tar command to tar a dir but that dir the user:group is owned by the user “bitwarden” and im tar’ing it under the user root but it works as i imagine root can do it even when it doesnt own it<\/p>\n
thanks,
\nrob<\/p>","upvoteCount":2,"datePublished":"2024-11-01T11:16:30.803Z","url":"https://community.spiceworks.com/t/tar-dir-thats-owned-by-different-user/1137125/1","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"}},{"@type":"Answer","text":"
You have posted a statement, not a question; is there something you want to know about tar?<\/p>","upvoteCount":1,"datePublished":"2024-11-01T12:25:26.721Z","url":"https://community.spiceworks.com/t/tar-dir-thats-owned-by-different-user/1137125/2","author":{"@type":"Person","name":"sprothero","url":"https://community.spiceworks.com/u/sprothero"}},{"@type":"Answer","text":"
What do you need help with, Robert?<\/p>","upvoteCount":0,"datePublished":"2024-11-01T13:28:58.444Z","url":"https://community.spiceworks.com/t/tar-dir-thats-owned-by-different-user/1137125/3","author":{"@type":"Person","name":"Rod-IT","url":"https://community.spiceworks.com/u/Rod-IT"}},{"@type":"Answer","text":"
just want to know if im right or wrong<\/p>","upvoteCount":0,"datePublished":"2024-11-01T13:30:00.907Z","url":"https://community.spiceworks.com/t/tar-dir-thats-owned-by-different-user/1137125/4","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"}},{"@type":"Answer","text":"
By default, tar stores the user and group numeric IDs, if you extract files as root, those numeric IDs are preserved, if you extract as a regular user, the extracted files take on the ID of the user doing the extraction, so yes, you are correct.<\/p>\n
One of the issues with tar files from another system is that the user and group IDs may not be the same, a tar file made on a RedHat machine may extract to the wrong user and group on a Suse machine.<\/p>\n
You can override the IDs preserved within the tar archive at creation or extraction time, but it becomes less of a simple tar command.<\/p>","upvoteCount":0,"datePublished":"2024-11-01T13:45:48.188Z","url":"https://community.spiceworks.com/t/tar-dir-thats-owned-by-different-user/1137125/5","author":{"@type":"Person","name":"stevejones4947","url":"https://community.spiceworks.com/u/stevejones4947"}},{"@type":"Answer","text":"
so even if i kick off the tar under logged in user root even if the folder is owned by bitwarden it will still tar it successfully, i know i will need to chmod and chown it<\/p>","upvoteCount":0,"datePublished":"2024-11-01T15:39:49.452Z","url":"https://community.spiceworks.com/t/tar-dir-thats-owned-by-different-user/1137125/6","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"}},{"@type":"Answer","text":"
Why should you want to chmod and chown?<\/p>","upvoteCount":0,"datePublished":"2024-11-02T16:41:20.355Z","url":"https://community.spiceworks.com/t/tar-dir-thats-owned-by-different-user/1137125/7","author":{"@type":"Person","name":"spiceuser-ovtxt","url":"https://community.spiceworks.com/u/spiceuser-ovtxt"}}]}}