Hi, I wanted to change the file ownership of a directory in root, but by mistake I gave the following command # chown -R <username>: / but Ctrl-C'd after a few seconds, after realising what I have done. After this I haven't been able to login as root. So I followed the procedure at http://www.novell.com/coolsolutions/trench/15629.html (viz. put the first CD of SuSE, rescue system, modify the passwd and shadow files). After I logged in again as a normal user and tried to login as root, it was still asking me for the passwd. Then I again went into rescue system, and then mounted /dev/sda1 where the home is and then removed the x from the root line. Also I modified the shadow file so that root looke like this root:::: After this I again rebooted the system and tried to login, now when I give su, it says the following. $ su su: cannot set groups: Operation not permitted Now I am not able to login as root into my machine. I am very badly stuck up. What can I do now? Regards, Chaitanya. ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs
Chaitanya Krishna A wrote:
Hi,
I wanted to change the file ownership of a directory in root, but by mistake I gave the following command # chown -R <username>: / but Ctrl-C'd after a few seconds, after realising what I have done.
[...] That was thorough, I'll give you that. (^-^)
Now I am not able to login as root into my machine. I am very badly stuck up. What can I do now?
Have you tried to change ownership of some important files back? For example in /etc the files passwd, group, shadow. In fact, you could just boot from rescue disc, make a backup of /etc, and then as a first step do "chown root /etc /sbin" If you can then boot into the system, have a look at /etc/permissions... It is a set of files that yast keeps track of to restore proper ownership if it is changed. Yast -> Security and Users -> Security Settings. Sandy -- List replies only please! Please address PMs to: news-reply (@) japantest (.) homelinux (.) com
Hi, I forgot to mention something in the last mail. After giving # chown -R <username>: / cd'd to / and then gave an ls, I saw that only the permissions of /dev and /bin were changed to the <username>. Therefore, I again gave # chown -R root:/ and then realised that it would change the permissions of /home, etc and then I again Ctrl-C'd. My reply to Sunny's suggestions can be seen below.
I wanted to change the file ownership of a directory in root, but by mistake I gave the following command # chown -R <username>: / but Ctrl-C'd after a few seconds, after realising what I have done.
[...]
That was thorough, I'll give you that. (^-^)
Now I am not able to login as root into my machine. I am very badly stuck up. What can I do now?
Have you tried to change ownership of some important files back? For example in /etc the files passwd, group, shadow. In fact, you could just boot from rescue disc, make a backup of /etc, and then as a first step do "chown root /etc /sbin" Both /etc and /sbin are root:root set to (user:group)
If you can then boot into the system, have a look at /etc/permissions... It is a set of files that yast keeps track of to restore proper ownership if it is changed. Yast -> Security and Users -> Security Settings. I can boot into the system, but I can't do anything using Yast coz it needs the root passwd.
Regards, Chaitanya. ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs
Chaitanya Krishna A wrote:
Hi,
I forgot to mention something in the last mail. After giving # chown -R <username>: / cd'd to / and then gave an ls, I saw that only the permissions of /dev and /bin were changed to the <username>. Therefore,
I again gave # chown -R root:/ and then realised that it would change the permissions of /home, etc and then I again Ctrl-C'd.
Wow, another good one. Simply tell yourself that it will be a good learning experience. (^-^) Just in case you get any other rash urges to exercise commands like that in a panic: DON'T exit a root shell when you have just done something likely to crash the system.
Both /etc and /sbin are root:root set to (user:group)
In that case you should be able to use the rescue cd to boot up, chroot to your original system and then use passwd to give root a password. PS: if you still feel adventurous and decide to experiment with files like passwd manually, you might want to make a BACKUP of it first! Sandy -- List replies only please! Please address PMs to: news-reply (@) japantest (.) homelinux (.) com
[Sandy Drobic]
Chaitanya Krishna A wrote:
Now I am not able to login as root into my machine. I am very badly stuck up. What can I do now?
Have you tried to change ownership of some important files back?
The OP has to login as root first. You may try the rescue system from the distributed CD-ROMs, maybe? -- François Pinard http://pinard.progiciels-bpi.ca
If you log in using the rescue system, can you chroot to the installed filesystem and run the SuSEconfig permissions module? -- "The man who strikes first admits that his ideas have given out." (Chinese Proverb)
participants (4)
-
Chaitanya Krishna A
-
Dylan
-
François Pinard
-
Sandy Drobic