I need to change the permissions on a folder and its sub folders from 'root' to me 'andrew'. First I need to log in as 'root' to be able to change this - correct? The folder is - /usr
.
Chown and Chmod commands have been mentioned to change permissions.
I can't change to root from the terminal as I don't know the password. Do I need to do something on boot up to log in as 'root'? I think I might.
I would appreciate an accurate concise answer. Please list the steps I need to take to do this.
/usr
and its subfolders - you will likely break your system – steeldriver Aug 06 '18 at 14:30sudo su
but just avoid to connect directly with root; most case just needsudo
, more safe – damadam Aug 06 '18 at 14:41/usr
is a terrible idea. Almost certainly you should be usingsudo
to do what you need there, rather than changing ownership or permissions. You can also usesudo
to runchmod
andchown
- there's no need to log in as root for that. – Zanna Aug 06 '18 at 17:17sudo
now, because, as the first error shows, you're already recursively messed up the permissions of/usr
withchmod
orchown
, which means you should reinstall Ubuntu to fix it easily, or faff around a lot to more-or-less fix it with difficulty. To copy or move files to a root owned location, you just usesudo
, likesudo cp my-file1 my-file2 my-file3 /usr/share/games/mame/roms
– Zanna Aug 07 '18 at 16:19sudo
binary having incorrect permissions or ownership. I know the command I suggested (that's what you should have done instead) won't work - no command withsudo
will work now because the permissions are wrong. What permissions have you changed? By default the root account on Ubuntu has no password (not a blank password) which means it can't be accessed. This is a security feature. It's possible (though unnecessary) to enable the account by setting a password for it, but you needsudo
for that, so you can't. Read the links I gave to fix this. – Zanna Aug 08 '18 at 06:40sudo -i
then in the root shellnautilus
(nautilus being the file browser program) (don't forget to exit the root shell when done) but these days you may need help from this answer – Zanna Aug 08 '18 at 17:01