LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   I deleted login.defs by a mistake :( (https://www.linuxquestions.org/questions/slackware-14/i-deleted-login-defs-by-a-mistake-806468/)

mortinoi 05-07-2010 05:55 AM

I deleted login.defs by a mistake :(
 
Hi guys,

I have recently deleted by a stupid mistake file /etc/login.defs thus I am unable to login; not even in single user mode. Basically it won't let me to type my password in, only the first "user login line" is available.

I have found login.defs somewhere online and intended to place it where it belongs using fs-driver in Win7 but the driver sucks and does not allow me to see my ext4 partition.

Anyone has any ideas how to restore my root account, please?

druuna 05-07-2010 06:09 AM

Hi,

Maybe you can use a linux live CD.

- Boot from the CD,
- mount the partition that houses /etc,
- restore the login.defs file.

Should, theoretically work.

Hope this helps.

mortinoi 05-07-2010 06:21 AM

Hi Druuna,

thank you for a quick response; I booted from my CD already using standard command, in my case hugesmp.s boot root=dev/sda3 rdinit= rw Unfortunately the result same, thus negative and I still cannot access the filesystem at all :(

Does it look like I gotta do a fresh install? :(

druuna 05-07-2010 06:28 AM

Hi,

Which cd are you talking about? I'm talking about a real liveCD, not the slackware install cd/dvd.

After it boots you should have a working linux environment (could be CLI or GUI depending on the cd).

From there you should create a mount point (example: mkdir /mnt/tmp_slack) and mount your slackware partition (mount -t ext4 /dev/XXXY /mnt/tmp_slack [replace XXXY with correct device and number, I'm guessing sda3]).

If all went well you should be able to cd to /mnt/tmp_slack/etc and replace your login.def.

Hope this helps.

mortinoi 05-07-2010 06:35 AM

Thank you, let you know shortly how I did :)

mortinoi 05-07-2010 08:52 AM

Unfortunately, I am back here again. It seems to me that Slack has no support for ext4 and its unable to mount it. If I try to add "-f" to the suggested command, it mounts, but the focused directory is empty. I have tried to find various drivers that could read my linux partition under windows, only ext2fsd does just listing / directories but down to the tree shows nothing. Any other ideas please?

PS: Just to make sure to avoid more time loss.... I downloaded whole folder slackware_current from official ftp server, because I would guess that iso provided won't be really the current. If I will burn the folder to the dvd would that be operationally equal to burned iso?

amani 05-07-2010 10:48 AM

Get parted magic cd and do it

http://www.wlug.org.nz/login.defs%285%29

If you cannot understand that then reinstall (keeping /home intact)

acummings 05-07-2010 10:49 AM

http://www.sysresccd.org/Download

DL and burn that to CD disk, boot from it and

You had already DL the .defs file you need onto your Windows partition, right?

Boot from above mentioned CD disk then use ntfs-3g to mount your Windows partition. Next, just copy your .defs from (Win) to its destination the Linux partition.

BTW it's a mystery to me why the Slack install CD disk didn't work for you. systemrescuecd makes it easy to use ntfs-3g for ability to do cross platform reads and writes to hard drive disk.

--
Alan.

bathory 05-07-2010 01:57 PM

Quote:

I booted from my CD already using standard command, in my case hugesmp.s boot root=dev/sda3 rdinit= rw
It should be root=/dev/sda3. I guess sda3 is your / partition

What Slackware CD are you trying to boot? IIRC Slackware 13 supports ext4, so just press <Enter> when at the boot prompt to boot using the default kernel on the cd (huge.s).
Login as root, mount /dev/sda3:
Code:

mount /dev/sda3 /mnt rw
and copy the missing file.


All times are GMT -5. The time now is 05:45 PM.