permissions waked
After copying fs to new partition the permissions wont work right at all. I cant use sudo, view virtual consoles, etc.
Is there any way to auto set the permissions like the installer does? |
Which directories were copied over? Do you still have the originals files on the original partition?
If so, you could run: find <dir>/ -printf "chown %u:%g %p && chmod %m %p\n" >fixperms.sh in the base of the old partition, inspect it and if OK, move it to the base of the new partition and run it. You may want to include only the directories you need, such as "find /bin /sbin /usr /lib /var ..." to skip /mnt/, /dev & /tmp. Be sure to inspect the scripts to see that they look right. This may give you an idea: Code:
find Documents/ -printf "chown %u:%g %p && chmod %m %p\n" | head -n 10 You should put your disto and version in your user profile on this site. If you use an rpm based disto, you can use "rpm -qVa" to validate the packages. A debian based system my have a similar command to validate debian packages. Code:
rpm -qlv gvim Most, but not all permissions in system directories will owned & group owned by root. The permissions of these to files may prevent using sudo. Code:
ls -ls /etc/sudoers /etc/shadow The problem was probably caused by not using the archive option when using cp. Also, be careful which directories you copy. Some like /proc shouldn't be copied. Some like /tmp are a waste of time copying. Your system may create the /dev/ directory when you boot. And/or your distro may have a command to populate the /dev directory with the devices you need. |
What distro do you use? It could be an selinux issue.
jschiwal, I reckon distri would imply the plural (think gelato/gelati). I've been meaning to suggest that one out for a while ;). |
It would indeed be easy if I had orig files and its permissions but i erased before verifying new copy. Reinstalling some packages helped a bit but some files are waked and doesnt operate right. Is there any other way to set default permissions on those files because it is impossible to do it manually.
|
Having copied it from a diffrent distro the /etc/passwd or /etc/group associations are misleading.
If I had a group with a value of 1000 on distro X then when I log into distro Y's group has a value of 1000 then it will be diffrent. so it doesnt matter what the name is, just the number. |
You still haven't indicated which distribution you are using.
Most files outside of /home are owned by root and group owned by root. /etc/passwd needs to be world readable (i.e. "o" read bit set) but shadow must be only root readable. Otherwise, you may not be able to log in. If you boot up with a live distro, you could use the live distro's permissions as the model and set the ones on the hard drive the same way. Then you may be able to boot and use your package systems verification to determine the permissions on other files and directories. |
the problem
chown -R root /
chmod -R 755 / that is a fool's way to mess up ur system then tell me how u gonna get it back? even if the /etc/passwd and group membership numbers are same nobody is gonna do anything because ownership is lost. |
You shouldn't do things with such broad strokes. For example, the programs in /bin/ will most likely be root:root owned with rwxr-xr-x.
In sbin, Code:
jschiwal@qosmio:~/work> find /sbin/ -not -group root -exec ls -l '{}' \; Code:
sudo find /etc/ -not -user root -exec ls -l '{}' \; Code:
sudo find /etc/ -not -group root -exec ls -ld '{}' \; Code:
ls /etc/init.d/ -l | sed -n '/^-rwxr-xr-x/!{ /^d/!p}' Your distro's install disk may have a repair option as well. There may also be a backup of the /etc/sysconfig files. Also if you have a full backup, you can restore the system that way. |
All times are GMT -5. The time now is 08:12 PM. |