I was using SSHFS for mounting remote FS (CentOS 7) to my work PC when I performed: sudo chown user:user /mnt/mountpoinSince remote FS looks like this:
dr-xr-xr-x. 6 0 0 1024 июл 21 2017 boot
drwxr-xr-x 21 0 0 3400 сен 15 2017 dev
drwxr-xr-x. 107 0 0 12288 апр 13 12:58 etc
drwxr-xr-x. 4 0 0 4096 апр 13 12:58 home
lrwxrwxrwx. 1 0 0 7 июн 6 2017 lib -> usr/lib
lrwxrwxrwx. 1 0 0 9 июн 6 2017 lib64 -> usr/lib64
drwx------. 2 0 0 16384 июн 6 2017 lost+foundAnd when I try change owner to root to any directories or files I see error: invalid user: ‘root:root'. I realize first I should get back access to /etc/passwd to root but I really can't understand how to do it...
1 Answer
I've managed to restore server. For this purpose I booted to Emergency Mode thru GRUB boot menu. So filesystem was mounted in read-only and I was able to login as root. Further, I remounted fs in read-write mode (mount -o remount,rw /) and change owner of root directory to root (chmod root:root /). In my case owner of root directory had id 1000. Subdirs had properly owner.