Questions tagged [ownership]

For questions related to file ownership in Unix/Linux operating systems.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

OpenLDAP __db.00# file permission reset to root

I have an openLDAP installed on my CentOS 7 VM. The user that is running the openLDAP is ldap:ldap. If the server has an unexpected shutdown, for whatever reason, files listed below get reset from the ...
Stultusaur's user avatar
0 votes
0 answers
60 views

restore root ownership of files from a mounted file system

I have a /dev/nvme0n1p3 ext4 partition where I have installed ubuntu 18.04 My personal files are at /home/sas/data I created a different /dev/nvme0n1p2 ext4 partition, where I installed ubuntu 22.04 ...
opensas's user avatar
  • 111
4 votes
4 answers
1k views

Delete all files without user permissions

I have a prompt that asks me to delete all the files in a directory that the owner (u) can't r, w, nor x, in one command. I tried this command: find data -type f ! -perm -u=rwx -exec rm -f {} \; ... ...
cow's user avatar
  • 81
6 votes
1 answer
2k views

Why does `ls` in Linux and macOS show different owners (uid) for the same file?

I copied some files to HFS+, using macOS, ensuring that it was copied exactly. On macOS these copied files have 501 as owner according to ls -han. I then plug in the HFS+ usb stick into Ubuntu, and ...
Andreas's user avatar
  • 511
0 votes
0 answers
248 views

AutoFs with specific user´s permissions

I have autofs working properly. I can mount a Windows share on Linux server without problems. But there is one issue: I don't want that mounted share to be public to all Linux users, just for a small ...
Daniel Castro's user avatar
0 votes
1 answer
203 views

Can www-data control root files on Ubuntu web servers?

I have read about a bazillion posts about how to set up web server ownership, directory, and file permissions. I have heard use root. Don't use root, use www-data. Don't use that, use a different user ...
DontAsk's user avatar
0 votes
0 answers
427 views

`chown` not working, even using sudo

I am getting this error from git: fatal: detected dubious ownership in repository at '/run/media/marcel/Хранилище/Dev/Desktop/SimpleAccent' To add an exception for this directory, call: git ...
MrArsikk's user avatar
0 votes
1 answer
109 views

Which first level directories in Linux should be owned by user?

Today, I have accidentally noticed that the following directories of the / are owned by user, rather than root: /home /lost+found /media /mnt /opt /snap /srv /swapfile /var I have no idea how that ...
S. N.'s user avatar
  • 287
0 votes
0 answers
165 views

Linux Ubuntu 20.04 - ownership changed to root for entire drive - permission changed to 777 for all files, cannot revert

I am running Linux Ubuntu 20.04 and for some reason unknown to me, one of my storage drives suddenly has changed ownership to root and all file permisions are read/write/execute for all users. A ...
UsernameError's user avatar
0 votes
1 answer
337 views

Steam not running proton games on separate EXT4 partition

I have a multi user system and if possible I'd like to prevent downloading every game 3 times. Because of that I made a separate ext4 partition for my steam games and selected the partition in steam ...
Nichtdu's user avatar
  • 13
1 vote
2 answers
96 views

mke2fs ignore root_owner

As you know, if there is no root_owner option, mke2fs use the user and group ID of the user running mke2fs. Let's test it on Ubuntu 22 x86_64 (mke2fs 1.46.5 (30-Dec-2021)): Generate image mke2fs -t ...
Андрей Тернити's user avatar
0 votes
1 answer
37 views

How to keep ownership to same user for dir

I have two users,memsql and 4px. I have copied dir from 4px user, home dir to memsql user home dir. I want the permission for dir poc & singlestore1 to be memsql , memsql. Instead of memsql & ...
Divyank's user avatar
  • 137
0 votes
0 answers
168 views

Is it possible to change the file permission of itself

I created a binary file with Go Language. The owner of the file will be "userA" and the execution permission is set as "userA". The above configurations is enabled using the ...
sabby's user avatar
  • 1
0 votes
1 answer
33 views

Typically, which file users (owners) come with a distro?

Typically, after installing a distro we get a root user and a sudo user. I don't know if these are typically the only users owning files (as a user/u or "owner"), are they? or are there ...
alfred's user avatar
  • 7
1 vote
1 answer
3k views

Does chown command allow to set group different from user group?

It may be a stupid question, but I don't understand a detail about the command chown. I haven't found any explanation for this detail yet, maybe because it's so obvious to everyone. When you change a ...
SuperFluo's user avatar
1 vote
1 answer
70 views

Copied file to have the same owner as its directory

Let's say that my user account is homer there is a background service marge running an account bart. marge is using a directory lisa for its data. I have set the owner of lisa to bart. If I create a ...
Damn Vegetables's user avatar
0 votes
1 answer
199 views

Update only permissions etc. with rsync

I'd like to know if the following scenario will update permissions, ownership, timestamps etc. Say I transfer a folder from a destination to another using rsync -zr source/ dest/, and then use the ...
telometto's user avatar
  • 1,985
0 votes
1 answer
1k views

'unarchive' module in Ansible doesn't change owner and group of extracted files and folder

I wrote this to extract the files and folder on a remote server.  It extracts them but doesn't change the owner and group of the extracted files. --- ...
OmiPenguin's user avatar
  • 4,318
1 vote
0 answers
162 views

Strange rsync behavior deleting already transferred files

I'm facing a strange issue with rsync. The server hard disk has failed and I've replaced it with a another one. The rsync command I'm using is identical and there have been no other changes. There ...
NoExpert's user avatar
  • 489
0 votes
1 answer
466 views

How does Linux keep track of file permissions?

This might be a dumb question, however I was wondering how does Linux keep track of the file permissions? We know if we do a "ls -l" we can see the file permissions but when I change the ...
remember5thofnovember's user avatar
2 votes
0 answers
259 views

Permission denied on file with 666 permissions [duplicate]

I run the following commands on a new VM: $ sudo adduser banana Adding user `banana' ... Adding new group `banana' (1034) ... Adding new user `banana' (1033) with group `banana' ... ... $ sudo touch /...
itsadok's user avatar
  • 733
6 votes
2 answers
1k views

Copying a file into a directory where I am a member of the directory group

I am attempting to copy a file into a directory where my user account is not the directory owner but belongs to a group that is the directory group owner. These are the steps I have taken: Create a ...
Stephen Mitchell's user avatar
1 vote
1 answer
580 views

How does Linux handle permissions of files created on a different machine?

As far I know, a file's ownership on Linux depends on the file's owner's UID. What happens if a user in a different machine has the same UID as a user on the server and then the file is copied to the ...
Ahmad Ismail's user avatar
  • 2,678
0 votes
0 answers
18 views

Any clues for using a mysql installation on a bitlocked W10 drive, from Linux OS on dual boot?

Booting to Linux Mint 20, I just installed a LAMP stack on this machine, accepting all default choices. But I already have all my databases on a Windows 10 bitlocked partition (now unlocked and ...
mike rodent's user avatar
  • 1,132
2 votes
2 answers
869 views

Cannot change the ownership mounting ntfs drive

Why I cannot change the ownership on mounting ntfs drive? I give uid=1000,gid=1000, etc in my /etc/fstab file, but found it is not working. So I'm testing it out on command line: root@host:~# mount | ...
xpt's user avatar
  • 1,560
1 vote
0 answers
108 views

Run clang-format from rootful container on bind-mounted host dir without changing ownership

I want clang-format run from within a container on a bind mounted host directory to keep the ownership of modified files. I have a simple Dockerfile which I'm running with podman. I bind mount the ...
user2183336's user avatar
1 vote
1 answer
234 views

Permissions and owner when drive moved from one server to another

I'm pretty sure this question is distribution and hardware neutral. I have a USB drive formatted ext4 with a directory (plus subs) configured for minidlna, owned root:minidlna with permissions 775. It ...
David1618's user avatar
2 votes
0 answers
662 views

How to copy entire directory as is (failed to preserve ownership)

I am trying to prepare Raspberry Pi image to be netbooted. I have downloaded IMG file of raspbian (for ex 2017-07-05-raspbian-jessie) and mounted it locally to linux box. I got two partitions. Now I ...
Dims's user avatar
  • 3,255
0 votes
1 answer
3k views

Ownership, disk drives and permissions

I encountered an issue with a disk drive which I already posted on. (For the curious: Issue with device after formatting) In short, one of my disks stopped allowing me to copy files by drag and drop ...
Atome's user avatar
  • 3
0 votes
1 answer
779 views

Mounting the Drive to the Raspberry Pi and changing DIR ownership

so, after having followed this guide here https://pimylifeup.com/raspberry-pi-mount-usb-drive/ I've ended up with an automatically mounted external fat32 drive but now the ownership of that folder it ...
Kerberos's user avatar
1 vote
1 answer
318 views

Change the Owner access Charlie root to user at a media device, possible?

how can I change owner access from Charlie root to user access for my media devices (partitions /media/da0s1) on FreeBSD?
gertzh4uj's user avatar
-1 votes
1 answer
759 views

Cannot change ownership/permissions of disk

I have an EXT4 disk mounted on /mnt/external I have also tried mounting it on ~/EXTERNALMNT. The disk is not an NFS share. It is an external USB drive. I can read from the disk but cannot write, ...
Murrax2's user avatar
0 votes
1 answer
720 views

how can I change ownership of files in the VirtualBox shared folder (from root:root)

I'm running Windows 10 host and RHEL 4.7 guest using VirtualBox 6.1. I use VMs to build code changes which are delivered to our subs without having to travel to build on target consoles. The problem ...
spemble's user avatar
  • 101
1 vote
0 answers
537 views

www-data user cannot access USB drive mounted in /var/www/html/folder

I have an Raspberry Pi with mounted USB external drive. I've mounted this USB (/dev/sda1) to /var/www/html/owncloud/data/drive as I want to be able to access it from my PHP applications (precisely: ...
PolGraphic's user avatar
0 votes
1 answer
218 views

user and group not getting set correctly for auto generated files

I am hosting a Magento 2 (onlineshop software) project on my dev machine. The user and group are set to this: user -> company group -> www-data In Magento 2 some files are getting auto ...
Black's user avatar
  • 2,079
0 votes
0 answers
439 views

Owner of folder has no permission on it

I have recently created a user who has no access to any shell commands. Problem is, this user can still vim, nano or ls into any file and see the content. I created a home/username/ folder only ...
Searme's user avatar
  • 1
1 vote
1 answer
985 views

Sharing a directory between users (using ACL) when some files are created with only owner rw (600) permissions

Background: I'm trying to share a folder between two users on the same machine . The normal way would be to have the two users in the same group set the parent folder to that group with rw and the s ...
DKebler's user avatar
  • 282
3 votes
2 answers
892 views

Change owner and group for specific owners only

My apologies for the silly/simple question - yet after searching the web and SE, I cannot find an answer for this specific issue. Question: How does one change the owner and group (system-wide) only ...
s3dev's user avatar
  • 205
4 votes
1 answer
3k views

How to get the numeric group owner of a file?

For a bash script, I need to find the numeric group ID from the file ownership attributes, similar to the output of ls -nl, but only the number. If possible, I would like to avoid big parsing magic ......
Bash Stack's user avatar
1 vote
0 answers
892 views

Cannot change ownership in SSHFS/FUSE

I encounter permission denied when trying to change the owner using chown of a folder on mounted SSHFS: # /etc/fstab sshfs#[email protected]:/mnt/data /data fuse user,_netdev,nonempty,...
Marek Suchánek's user avatar
0 votes
1 answer
144 views

Group owner of ext4 filesystem changed

Having changed from using a Ubuntu-based operating system to using an Arch-based one, all of my ext4 volumes and everything in them have changed from being owned by $USER:$USER to now being owned by $...
EmmaV's user avatar
  • 4,067
0 votes
3 answers
851 views

Find specific folders and then change their ownership

I'm running into security issues with multiple Wordpress websites, and I need to recursively change the ownership (and permissions) for folder "wp-content" (and whatever is inside them). I ...
Leandro Dimitrio's user avatar
2 votes
0 answers
2k views

exportfs: could not open /var/lib/nfs/.etab.lock for locking: errno 13 (Permission denied)

When I am using this command to check NFS: exportfs -a ... it shows this error: [miao@k8sslave3 lib]$ exportfs -a exportfs: could not open /var/lib/nfs/.etab.lock for locking: errno 13 (Permission ...
Dolphin's user avatar
  • 609
3 votes
1 answer
886 views

Rsnapshot: folder ownership permissions to 'backups' group instead of root

I am using rsnapshot to make daily backups of a MYSQL database on a server. Everything works perfectly except the ownership of the directory is root:root. I would like it to be root:backups to enable ...
Kit Johnson's user avatar
1 vote
1 answer
442 views

inotify: avoiding a loop of repeated file changes

I am using inotify (implemented via pyinotify) on my Ubuntu 18.4 system in order to monitor creates, modifies, and attribute changes in certain directories. I use these watch flags: IN_CREATE, ...
HippoMan's user avatar
  • 605
12 votes
4 answers
5k views

chmod and chown at the same time?

I have a script I'm running to fix file ownership and permissions after an rsync. Questions of the optimal way to do my task aside, I wonder, is there a way to run chmod and chown at the same time? ...
user394's user avatar
  • 14.4k
1 vote
2 answers
2k views

View size and owner on folders, within a folder

Anyone know how to view all the folders within an directory with size, folder/file, owner? The only command I know of is du -hs * But that shows all the subfolders aswell and does not show owner. ...
Hultman's user avatar
  • 13
1 vote
2 answers
122 views

Why owners of files and folders can modify it's contents if they don't have permissions on the parent directory?

An example of my question would be the /home directory: drwxr-xr-x 8 root root 4096 Jan 29 23:44 home/ So, the owner of /home is root. But I'm the owner of my personal home folder: drwx--x--- ...
Teodoro's user avatar
  • 153
1 vote
1 answer
569 views

Can I avoid using `sudo` to back up files owned by root?

I'm using rsync to back up a set of files in /etc. The 'source' files are on an ext4 filesystem, and the 'destination' is an ext4 partition on a USB thumb drive. My incantation is similar to this: ...
Seamus's user avatar
  • 2,949
3 votes
1 answer
34 views

Find out what is mounting my external HD and change ownership?

OS: Linux Mint 18.3. I have an NTFS-formatted external HD which just gets automounted when I boot up. I'm just trying to find out what actually does that, and whether it's possible to set the ...
mike rodent's user avatar
  • 1,132