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.

39 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
3k views

Run script with root permission as normal user

Problem: How can I run a script owned by root with root permission as normal user? Let's take for example a folder /path/to/folder. First I make sure that the folder and all content is owned by root: ...
ningelsohn's user avatar
2 votes
0 answers
2k 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 ...
admi22's user avatar
  • 21
2 votes
0 answers
2k 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 ...
Mutante's user avatar
  • 121
2 votes
2 answers
2k views

Understanding file ownership Linux

I have a Java program on my Linux box and I wanted to create a little one-liner shell script in /bin to prevent having to navigate to the folder of the program and setting all the command line ...
Speccy's user avatar
  • 353
2 votes
2 answers
3k views

Rsync: after copying as root, change owner to the web user

I seem to come up against this issue occasionally: serverA assets: owned by user: apache (no 'ftp' user present) serverB assets: owned by user: ftp (apache user present, but not used) I connect ...
brock's user avatar
  • 121
2 votes
1 answer
789 views

Unable to create files in a directory

I have created a directory in Virutalbox. Using VBoxManage, I am executing a script inside the Ubuntu VM directory I created above from Ubuntu host OS. But if the script in the VM contains commands ...
vamsi360's user avatar
2 votes
0 answers
1k views

Ubuntu 10.04 with vsftpd: Can't chown /var/www?

For the life of me, I can't seem to chown my /var/www folder on my server. i want to: chown -R ftpuser /var/www And it returns Invalid Argument on every file change attempt. I've tried sudo with ...
user avatar
1 vote
0 answers
601 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 ...
Max R.'s user avatar
  • 111
1 vote
0 answers
58 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". ...
Ryan's user avatar
  • 11
1 vote
2 answers
996 views

Used recursive chown on the root directory

I'm going to need some help restoring my ssh settings as I screwed everything up by calling this command: chown -R user / At the moment im not able to access the site through ssh/ftp since the ...
user avatar
0 votes
1 answer
41 views

Messed up with /dev/tty* ownership

I was flashing a Flipper Zero Wifi Dev Board and I needed to have /dev/ttyACM0 owned by dialout group... The thing is now I have tried to revert the stuff, making a chown root:tty /dev/tty*, and chmod ...
DaniWein's user avatar
0 votes
0 answers
58 views

Possible in Linux for root to take ownership of a running process without restarting it?

There is a process running under my personal login id that I want to run under root instead. This is only temporary for troubleshooting a problem with it. My login id has sudo privilege but is not ...
bgibson's user avatar
  • 103
0 votes
0 answers
221 views

cygwin /usr/bin/install cannot change permissions

When I run /usr/bin/install, I get permissions errors: bifrost ~ 857# groups None Local account and member of Administrators group tsysadm Administrators Users NETWORK Authenticated Users This ...
Erik Bennett's user avatar
0 votes
1 answer
673 views

how to change user and group of a file inside the docker in gitlab-ci

I have a file which when I mount it to the docker, the user and group will change. root@b2d3cb9b2aab:/# ls -lh /etc/logrotate.d/ total 36K -rw-r--r-- 1 root root 120 Sep 11 2021 alternatives -rw-r--...
Amir's user avatar
  • 577
0 votes
0 answers
49 views

Using sgid bit on specific executable files to filter their traffic with iptables

I'm trying to filter traffic with iptables for specific applications by their effective owner id (--gid-owner). For this purpose I've created a group $ sudo addgroup net-user , set this group on an ...
raacer's user avatar
  • 563
0 votes
0 answers
176 views

Mistake - sudo chown -Rh not-root-user /

Well that. Made a terrible mistake on ubuntu server 18.04 (production server) and ran chown -Rh some-not-root-user / Now sudo is not working. Is there any way to reverse this?
Legna's user avatar
  • 101
0 votes
0 answers
551 views

Is it safe to change ownership of several sub directories in /usr/local on MacOS Big Sur?

When trying to install some support for FORTRAN on my macBook running Big Sur and using brew I get an error that some /usr/local folders are not writeable and am asked to use chown to change ownership ...
Nate Lockwood's user avatar
0 votes
0 answers
361 views

How do you set read-only in NFS without root privilege on Linux?

This seems like a relatively straightforward question, but I couldn't really find an answer to this on knowledge bases. Problem I want to protect some files so they cannot be edited, deleted by other ...
boomkin's user avatar
  • 101
0 votes
1 answer
240 views

Recover Ubuntu file owners after improper use of chown

I made the mistake of changing the owner with the command sudo chown -R userG: userG / Now MySQL and other things not working, I try to repair but the ** sudo ** command does not work Give this error ...
sutanejo 's user avatar
0 votes
2 answers
2k views

chmod/chown/mkdir: Operation not permitted as root

I get Operation not permitted for root user on one server but not on the other "identical" server. Running on Amazon Linux 1. Server 1: [root@preprod-1 ]# chown root:root /s3mnt/outliers/ ...
masterpiece's user avatar
0 votes
1 answer
155 views

Using the chown linux command to allow permission on a user and group

The question Recursively set the owner and group of /home/shared/salesproject/ and its contents to sam and sales. I know it would start out 'chown -R' how would the rest go?
jeski2020's user avatar
0 votes
0 answers
43 views

How to (effectively) make a group an owner for changing privileges

I have data on disk which has a high likely-hood of accidentally being modified and I want to remove all write privileges by myself or anyone else. However, occasionally this data DOES need to be ...
nanotek's user avatar
  • 101
0 votes
0 answers
60 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 ...
Human_BetaRelease's user avatar
0 votes
1 answer
1k 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 ...
Lorenço Santos's user avatar
0 votes
2 answers
468 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.
hd.'s user avatar
  • 123
0 votes
1 answer
4k 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 ...
Qqwy's user avatar
  • 4,447
0 votes
0 answers
794 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 ...
Lightning77's user avatar
0 votes
0 answers
906 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 ...
Justin's user avatar
  • 153
0 votes
0 answers
84 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 ...
user_mda's user avatar
  • 101
0 votes
1 answer
73 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 -...
Hans de Jong's user avatar
0 votes
1 answer
73 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 ...
user avatar
0 votes
0 answers
226 views

Changing privilege rights on Arch Linux for a particular program

I am quite new to linux and have had issues surrounding every program that I install. Basically, anything that is placed outside of my home directory requires a sudo call prior to opening/executing. I ...
sherrellbc's user avatar
0 votes
1 answer
714 views

Unable to retain any root created files and folders after warm reboot in linux

I installed and ran petalinux on zynq board. It runs perfectly fine and boot in around 3 seconds. To boot it this fast I had to do some configuration before compiling the source. The problem that I ...
gpuguy's user avatar
  • 271
0 votes
1 answer
175 views

Ubuntu file ownership issue

I've got a problem with my forum platform being unable to install modifications, as it complains the "Packages" directory isn't writeable. It's chmodded to 0777, so it's not a permission issue, but an ...
i-CONICA's user avatar
  • 116
0 votes
1 answer
268 views

chown for files generated by a process running as root

I have a Fedora server running an application as root (via sudo). The users operating the application can extract data with "Save as" menu from inside the application. However, the generated files has ...
Andy Le's user avatar
  • 161
0 votes
2 answers
94 views

None of my directories are writable

Argh help lol I have ran a chown command (silly me) which I did not fully understand now when I connect via filezilla and try do anything write/delete files/directories I get Error: mkdir /var/www/...
Kal's user avatar
  • 125
0 votes
1 answer
89 views

Give Apache and Account User File Writing Priviliges

I am using OS X Mountain Lion for web development. I am running the built-in Apache server. Now I need to allow the PHP script I am running to write in a directory. But if I chown the directory to ...
Sawant's user avatar
  • 101
0 votes
0 answers
75 views

Chown permission not allowed while restoring from LTO drive

i have to restore some file to my network system from LTO Tape, i use bru command to restore the file. but it is giving an error message chown permission not permited.
sw.tushara's user avatar
-1 votes
1 answer
4k views

Take control of all disks/filesystems automatically in linux (Kali)

I have two mac disks plugged into my Linux Kali and for the life of me I cannot get ownership of them. (LaCie) I don't have this problem in Windows or Mac, I just copy the files. Drag and drop. But ...
Graham's user avatar
  • 1