You are not logged in.

#1 2020-05-17 20:29:04

eric.meehan
Member
Registered: 2020-01-01
Posts: 52

[SOLVED] /home/username owned by root and refuses chown from root.

On a fresh install of Arch, I created a user with sudo permissions.  The user's home directory is owned by root for some reason.  (I am using this computer as a Minecraft server... trying to anyway).

ls -l /home/username

drwxr-xr-x 3 root root 4096 May 16 19:14 minecraft

When I login as root, I cannot change the ownership of this directory to the user:

chown username /home/username

chown: changing ownership of '/home/username': Operation not permitted

I've tried doing this as root and username (the only two users on the system) and neither can change the ownership of this directory.  I cannot run the command to install Minecraft-server unless I have write permissions as the user, as I cannot do so as the root.

makepkg -si

(from within the git download).

I have Arch running on several machines, this is the only one that set the ownership of /home/username to root.  Why would it do this?  How would I fix it?

Thanks!

Last edited by eric.meehan (2020-05-17 22:53:28)

Offline

#2 2020-05-17 20:32:33

loqs
Member
Registered: 2014-03-06
Posts: 19,074

Re: [SOLVED] /home/username owned by root and refuses chown from root.

What command was used to create the user username?

Offline

#3 2020-05-17 20:42:32

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,818

Re: [SOLVED] /home/username owned by root and refuses chown from root.

Also we've so far only seen the permissions of he minecraft directory nor the actual error when you try to change the owner as root (which *will* be required)

stat /home/username
grep username /etc/passwd
sudo chown username:username /home/username
mount

Online

#4 2020-05-17 20:43:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,519
Website

Re: [SOLVED] /home/username owned by root and refuses chown from root.

Are you using systemd-homed?  What's the output of `stat /home/username` and `findmnt /home/username`?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2020-05-17 21:11:04

eric.meehan
Member
Registered: 2020-01-01
Posts: 52

Re: [SOLVED] /home/username owned by root and refuses chown from root.

loqs wrote:

What command was used to create the user username?

During install I used

 
useradd -m -g users -G wheel username

I also edited visudo to allow the group wheel to use sudo by uncommenting the line:

%wheel ALL=(ALL) ALL

Offline

#6 2020-05-17 21:17:48

eric.meehan
Member
Registered: 2020-01-01
Posts: 52

Re: [SOLVED] /home/username owned by root and refuses chown from root.

Trilby wrote:

Are you using systemd-homed?  What's the output of `stat /home/username` and `findmnt /home/username`?

seth wrote:

stat /home/username
grep username /etc/passwd
sudo chown username:username /home/username
mount

I'm going to stop editing my username to "username" in the commands to give the output more precisely.

stat /home/eric

  File: /home/eric
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 801h/2049d	Inode: 3           Links: 3
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-05-17 00:00:00.000000000 +0000
Modify: 2020-05-17 13:21:42.000000000 +0000
Change: 2020-05-17 13:13:44.500000000 +0000
 Birth: -
grep /etc/passwd

eric:x:1000:985::/home/eric:/bin/bash

This next one gave output indicating the command wasn't properly written, so I edited it.  Original:

sudo chown eric:eric /home/eric

chown: invalid group: 'eric:eric'

Edited:

sudo chown eric:users /home/eric

chown: changing ownership of '/home/eric': Operation not permitted
 
mount

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=1729108k,nr_inodes=432277,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda2 on / type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=11071)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda1 on /home type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=347496k,mode=700)
findmnt /home/eric

(returns nothing)

Thanks for the help!

Last edited by eric.meehan (2020-05-17 21:22:24)

Offline

#7 2020-05-17 21:19:43

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] /home/username owned by root and refuses chown from root.

Why is your /home formatted as FAT?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2020-05-17 21:24:47

eric.meehan
Member
Registered: 2020-01-01
Posts: 52

Re: [SOLVED] /home/username owned by root and refuses chown from root.

jasonwryan wrote:

Why is your /home formatted as FAT?

It was not.  I formatted the boot partition as FAT, but /home is a linux filesystem.

If you have a command I can use to double check this, I would appreciate it.

Offline

#9 2020-05-17 21:29:52

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,818

Re: [SOLVED] /home/username owned by root and refuses chown from root.

sudo file -s /dev/sda1

Did you accidentally mount the boot partition at /home?

Online

#10 2020-05-17 21:29:57

merlock
Member
Registered: 2018-10-30
Posts: 262

Re: [SOLVED] /home/username owned by root and refuses chown from root.

eric.meehan wrote:
jasonwryan wrote:

Why is your /home formatted as FAT?

It was not.  I formatted the boot partition as FAT, but /home is a linux filesystem.

Yes, it is.  Look at the output of your mount command:

eric.meehan's mount command wrote:
/dev/sda1 on /home type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)

Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '

Offline

#11 2020-05-17 22:24:38

eric.meehan
Member
Registered: 2020-01-01
Posts: 52

Re: [SOLVED] /home/username owned by root and refuses chown from root.

seth wrote:
sudo file -s /dev/sda1

Did you accidentally mount the boot partition at /home?

merlock wrote:

Yes, it is.  Look at the output of your mount command:

Well I'll be damned.  Sorry about that, when I installed the os I mounted /dev/sda2 to /home like I did on my other installations (unless I made a typo during the procedure.  The computer is old and has sticky keys).  Why would that affect the permissions?

Offline

#12 2020-05-17 22:40:06

loqs
Member
Registered: 2014-03-06
Posts: 19,074

Re: [SOLVED] /home/username owned by root and refuses chown from root.

FAT does not have a concept of user / group ownership so the kernel assigns root by default.

Offline

#13 2020-05-17 22:53:07

eric.meehan
Member
Registered: 2020-01-01
Posts: 52

Re: [SOLVED] /home/username owned by root and refuses chown from root.

loqs wrote:

FAT does not have a concept of user / group ownership so the kernel assigns root by default.

It seems I made a mistake during the installation.  Thanks for the help!

Offline

Board footer

Powered by FluxBB