LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 05-07-2010, 06:55 AM   #1
mortinoi
LQ Newbie
 
Registered: May 2010
Posts: 6

Rep: Reputation: 0
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?
 
Old 05-07-2010, 07:09 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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.
 
Old 05-07-2010, 07:21 AM   #3
mortinoi
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
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?

Last edited by mortinoi; 05-07-2010 at 07:24 AM.
 
Old 05-07-2010, 07:28 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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.
 
Old 05-07-2010, 07:35 AM   #5
mortinoi
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Thank you, let you know shortly how I did
 
Old 05-07-2010, 09:52 AM   #6
mortinoi
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
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?

Last edited by mortinoi; 05-07-2010 at 09:59 AM.
 
Old 05-07-2010, 11:48 AM   #7
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,758

Rep: Reputation: Disabled
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)
 
Old 05-07-2010, 11:49 AM   #8
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 49
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.
 
Old 05-07-2010, 02:57 PM   #9
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
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.
 
  


Reply

Tags
root password


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
umask & /etc/login.defs gepesz Linux - Software 2 09-04-2011 04:02 AM
login.defs password expiry noir911 Linux - General 1 01-07-2007 12:38 PM
/etc/login.defs binary_0011 Linux - Newbie 1 11-06-2006 09:44 PM
/etc/ Login.defs will not save my settings??? wardialer Linux - Security 2 03-09-2005 09:37 AM
Startup script=/etc/login.defs? ~zoey~ Linux - Newbie 2 11-13-2004 12:44 AM


All times are GMT -5. The time now is 08:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration