Questions tagged [chown]

The chown command shell of a Unix-like operating system (such as GNU / Linux) is used to change the owner of a particular file.

Filter by
Sorted by
Tagged with
1
vote
1answer
29 views

Can't delete, chown or chmod file even as root

I want to delete a backup of a website (FTP-mirrored with wget), but a single file, named js_composer.less resists. I can create new files and delete them in the same directory, so the problem might ...
0
votes
0answers
22 views

XenForo folder permission error

Recently I migrated my website from a server to another. The OS and the web server software are the same on both servers (Apache HTTPD on CentOS 7). When I transferred the forum I encountered a ...
2
votes
1answer
145 views

Why is a normal user allowed to give away a file/folder by running `podman unshare chown`?

I think that usually a normal user is not allowed to give away a file or directory by running chown without sudo. A question was asked and answered at unix.stackexchange:Why can't a normal user chown ...
1
vote
0answers
202 views

chown has no effect inside docker container

Core problem I have some files that are currently owned by 'root': root@b75277d71d6f:/app/config/jwt# getfacl public.pem # file: public.pem # owner: root # group: root user::rwx group::r-x ...
0
votes
0answers
22 views

How to overwrite files and preserve TARGET attributes?

I'd like to overwrite files in a way that preserves the TARGET ownership and permissions. It seems like something cp should do, but cp --preserve=... refers to the SOURCE attributes, not the TARGET ...
0
votes
0answers
37 views

Cannot start MySQL-Server after changing the owner for /opt/lampp/var/mysql

I am asking for your help to start MySQL-Server (Xampp-Local Server). After I changed the owner for the directory /opt/lampp/var/mysql I was not able to launch MySQL-Server. The Appach-Server works ...
0
votes
0answers
26 views

Ubuntu 18.04 SFTP with users and one major user

I have an Ubuntu 18.04 system running and want to access this system using SFTP. I have a lot of users, that shall access /var/ftp/data/%u, additionally, I need a user f_sftp, that can access and read ...
1
vote
0answers
355 views

FTP User/Group permission on VSFTPD and UBUNTU

I developed a vsftp server with three user groups: g1, g2, g3. Each group has a folder with its name. For example. /home/server/g1 /home/server/g2 /home/server/g3 Each group also has users sudo ...
0
votes
1answer
105 views

Linux auto chown web uploaded files to users folders

I have a home server that stores my files and I access the files in my internal network with samba. I have 3 users and each user has its home folder on /home/user. In order to access the files from ...
2
votes
3answers
2k views

How to automatically change permissions and owner:group on any file added to a specific directory?

I run an unRAID server (unRAID is based on Slackware) and would like to find a way to automatically change the permissions and ownership of every file added to a specific directory. Specifically, I ...
0
votes
1answer
78 views

Can I undo a `sudo chown -R /` on Mojave? [duplicate]

I ran a command that ended up executing as sudo chown -R / Can I revert / to default permissions?
0
votes
1answer
42 views

How do I stop a file changing groups when it is edited

My Debian LAMP web server has files in the website document root with owner:group set at [username]:www-data. When I edit such a file by connecting using sftp and using a text editor the group ...
1
vote
0answers
486 views

Mount a windows path (cifs) in a voulme of a docker image

I have a windows file server and an Ubuntu machine which runs docker. Inside this docker there is a Nextcloud container. The /var/www/html inside ther Nextcloud container is mounted as volume on the ...
0
votes
0answers
1k views

sudo chown - operation not permitted

I don't understand why I'm not allowed to change the owner of a folder as root user (the folder is mounted with a hard disk). root@raspberrypi:~# chown -R www-data:www-data /media/hdd chown: ...
3
votes
3answers
8k views

chown -R exclude some directory

I want to exclude some large content directory I'm Using it to chown Directory chown -R admin /home/admin/web/public_html is there anyway to exclude a subdirectory under html Like: chown -R admin ...
-1
votes
1answer
313 views

i need help reversing a chmod, chown and 'whoiam' code

I used this code on an app: chmod 600 /Applications/Freedom.app ; chown 'whoami':staff /Applications/Freedom.app Does anyone know how to undo this?
7
votes
3answers
16k views

chown: /usr/local: Operation not permitted

How should I fix this? Tue Oct 31 21:52:56 mona@dhcp-wifi-8021x-155-41-82-88:~$ brew update && brew upgrade && brew cleanup Error: /usr/local is not writable. You should change the ...
0
votes
1answer
1k views

Can't change owner of folders/files on thumb drive

I have a drive being mounted (either manually or automatically using usbmount) and I can't change the owner or modify the permissions on the mounted drive or folders/files within in order for Mono to ...
1
vote
1answer
1k views

How may I mount an external drive in fstab and give owbership to multiple users?

I mount an external drive on my Raspberry-Pi (Debian/stretch) and I mount my external drive in the fstab like this: UUID=1AD09862DC893951 /media/USBHDD1 ntfs-3g nofail,uid=pi,gid=pi,umask=007 0 0 ...
0
votes
2answers
584 views

Centos: Apache needs to read files created by Tomcat

After trying a lot of different solutions I came here for some help. I have a web apps in apache HTTPD which serve the frontend and a Java app in Tomcat in the same server. The thing is that the ...
0
votes
2answers
2k views

Ownership remains unchanged after `sudo chown` in ubuntu

sudo chown reports that it has changed ownership but stat shows that they remain unchanged. I have absolutely no clue as to what might be causing this behavior. Commands and their output are listed ...
0
votes
2answers
83 views

How to see when folder access permission is changed?

How to see when folder access permission is changed? The folder now has 777 permission and I want to know when chmod command is run for it. Is it possible? My OS is Ubuntu. Thank you.
2
votes
1answer
15k views

What is the effect of “chown nobody:nogroup”?

What is the effect of chown nobody:nogroup on a single file or directory and what is the effect on files within a directory?
0
votes
1answer
3k views

Setting up a local development environment with nginx on Linux (ubuntu)

I recently moved to a new computer, and copied over all existing git repositories for webdevelopment projects from my old computer. On that old computer, I had installed apache to serve certain ...
1
vote
1answer
1k views

Undo mistaken chown of /usr/bin on macOS Sierra

I made a huge mistake. I wanted to change permissions for /usr/local/bin, but changed permissions for /usr/bin instead. Now I can't use sudo and others. I tried to change it back, but operation is not ...
1
vote
1answer
963 views

linux permissions / chown vs ftp

I have (I guess basic) problems with Linux permissions/ownership. I have FTP user "ftp". Then I have all files on my server under different user "nginx". To make the websites work I need to have all ...
0
votes
0answers
556 views

cannot chown file as root

After mounting a NTFS or fat32 partition (not as readonly), I try to change it to my user permissions with sudo chown user: file However I am then told that the "Operation is not Permitted". I have ...
1
vote
2answers
5k views

How to fix broken “etc/sudoers” ownership on EC2?

Backstory: I was trying to get PHP to execute node, but ended up changing permissions / ownerships on probably more files and folders than I should of. At one point I stumbled upon someone's ...
1
vote
0answers
35 views

Logging into new FTP server, but no directories show up

I've tried this with both ProFTPD and SFTP. I'm trying to chroot a user to /var/www/user however when I log in to the FTP server with their account, I get "/var/www/user: No such file or directory". ...
0
votes
0answers
479 views

Best way to ensure the contents of a directory is always owned by Apache

We have a couple Apache VirtualHosts on a CentOS 7 server, and the PHP sometimes requires the ability to create/edit/delete files and/or folders, so it's important that the permissions always be ...
1
vote
2answers
1k views

How to use wilcards on chown command?

I need to use wildcards on chown command. Example: # chown app:demo /opt/app/users/*/demo I get the following error: chown: can not access "/opt/app/users/*/demo" ': No such file or directory But ...
0
votes
1answer
457 views

Change owner on its own directory

I have a script running with the user user1:user1, making operations inside a directory dir. At the end of the script, I would like to use chown to change the owner of the script to user2:user2 But ...
0
votes
1answer
198 views

Script asks for root password even it has executable permissions for everyone

I have a script with name "somescript", which has executable permissions for everyone (755) but when I try to run it with a non-root user it keeps asking root password. I even tried setting to 4755 ...
2
votes
2answers
3k views

Unix chown/give permissions to www-data and user

I have a user, 'joe', to whom I would like to grant permissions (for /var/www/html/) so that I can use ftp (with vsftpd) So I run this command: sudo chown -R joe /var/www/html/ And that goes well, ...
0
votes
0answers
72 views

Unable to change owner on a mapped drive directory

I am using a script to copy files from amazon instances to a network drive using rsync. After the file copy I am trying to change the owner of these transferred files but am not able to. What is the ...
0
votes
2answers
510 views

Confirmation prompt for chmod, chown

I'm just trying to add a confirmation prompt to a few linux commands like chmod and chown. I've tried to google this but I can't find much information on the topic. While searching I found out ...
2
votes
1answer
391 views

SSHFS mount marked all files as hidden

I ran chown -R me:me /opt/web/ftp-mounts/ which affected files on sshfs ftp mounts. The remote server hosts IIS based websites. I might have messed up the file permissions on the remote host. Now ...
1
vote
1answer
38 views

Is there any existing tool to recursively substitute the UID/GID by any other?

I used to own the UID #1000 on my personal computers as it is the default in most Linux distributions. On my new computer, I own a completely different UID (which I cannot change). I want to access ...
2
votes
1answer
392 views

How to chown file to containing folders owner

How would you go to chown a file to the containing folder's owner lets say I moved a file from /home/userA/folder/abc.bin towards: /home/userB/finalfolder/abc.bin How can I chown abc.bin to ...
3
votes
1answer
4k views

Why can't I use my newly created user with chown?

So I am attempting to create a new user and group, and then change ownership of a directory to that new user/group. However, when I do, chown comes back with an "illegal user name" message. Here's a ...
0
votes
2answers
748 views

chown -R root:root .* in /root performs chown on /

When running the command in the title from /root it somehow jumps up to / and changes ownership for ALLfiles, i only noticed because error messages for /proc popped up. Maybe i'm getting old but ...
2
votes
3answers
4k views

Why I can't access to this directory after that I use the chown command?

I am not so into Linux and I have the following problem. I have installed a LAMP environment of an Ubuntu Linux system dedicated to the develop (it is on my PC and it is not a production server). So ...
0
votes
2answers
2k views

chown not working on ext4 hard drive

I have a new 3TB internal hard drive and after writing some data to it I completely zero'd the drive using DD. I then created a partition table (GPT) in Gparted and created an ext4 partition. All went ...
0
votes
1answer
59 views

chown -R does not set permissions of files. only directories

Hello i am setting up a server nginx gives 403 Permission dinied. I found out that somehow the command chown -R root:www-data /my_directory only set the permissions of directories. When i use ls -...
0
votes
1answer
79 views

Make my custom program root

I have a custom program in C, that iterates trough a directory and writes a log file with the contents in my home. However, it cannot acces /var/log/ /etc/ and other root folders. How to change that? ...
0
votes
1answer
67 views

wubi chown mysql to the /host folder not working

I installed wubi in D: driver. Since I want to store mysql database folder in D: driver which has a lot more space than inside wubi. I copy /var/lib/mysql to /host/mysql then change the database dir ...
0
votes
1answer
71 views

Checking if specific user used chown on specific directories?

I recently granted one user sudo access rights on test server. This morning I see that server is screwed up. I see that owner rights where changed on many directories. For example many root ...
5
votes
2answers
20k views

Change default permissions for new files and folders

Every time I create a new file or folder in Linux, it is accessible for r/w by myself, not the group. I want to change my system setting such that every new file or folder will be automatically ...
1
vote
1answer
842 views

Is it possible to disable chmod/chown from sudoers for these specific directories /usr and /etc?

There has been two occasions where I have accidentally chmod-ized 777 the whole direcotry of /etc and it has forced me to come to the decision that I'd be better off to do fresh installation of OS (...
0
votes
1answer
77 views

Granting full rights on all files (owned by su) within certain directory

I got some trouble with a server situation, where i keep some configuration files in a sub-directory of a web project. Using my superuser account, i make changes to these files, which NetBeans commits ...