Current time: 11-26-2024, 10:53 AM Hello There, Guest! (LoginRegister)


Post Reply 
root account locked because of stupid move
Author Message
prale Offline
Junior Member
*

Posts: 92
Joined: Feb 2008
Reputation: 1
Post: #1
root account locked because of stupid move
Hello I accidently dissabled my root login.

# vi /etc/ssh/sshd_config
Port 222
PermitRootLogin no

And I don't have another user than root :S

The only thing what I can do is boot in resque mode, then user root gets a random password and ssh port is at 22 again.

The problem is that I can't save changes to sshd_conf any more, because after a reboot is seems like the file before I moved into recovery mode is back again (port 222 for ssh).

Also the command adduser works, but I can't login with it.
I'm reconsidering a complete reinstall of debian an ispcp, but hopefully someone knows the trick to fix it.
(This post was last modified: 02-25-2008 02:44 AM by prale.)
02-25-2008 02:42 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #2
RE: root account locked because of stupid move
Hi

First: this is absolutely no ispcp question - rather SmallTalk.

Normally in rescue mode, you're no on your filesystem. This means you have to mount your / (root) Partition and then make the changes there. Then umount and reboot and then you're fine.

/J
02-25-2008 02:52 AM
Visit this user's website Find all posts by this user Quote this message in a reply
prale Offline
Junior Member
*

Posts: 92
Joined: Feb 2008
Reputation: 1
Post: #3
RE: root account locked because of stupid move
I'm sorry that I must ask this, but can you simply explain how to mount that partition?
In the meantime I'll google some tutorials etc...
02-25-2008 02:58 AM
Find all posts by this user Quote this message in a reply
Cube Offline
Member
***

Posts: 740
Joined: Apr 2007
Reputation: 9
Post: #4
RE: root account locked because of stupid move
Are you using Virtuosso? There the filesystem of your server is in a directory like /repair.
02-25-2008 03:03 AM
Find all posts by this user Quote this message in a reply
prale Offline
Junior Member
*

Posts: 92
Joined: Feb 2008
Reputation: 1
Post: #5
RE: root account locked because of stupid move
No just 1dedicated machine only.

I googled:

mount /dev/hda1 /mnt
vi /mnt/etc/shadow

and I'm gonna try it, I hope /mnt/etc/ssh/ is also editable since I don't need to change the root passwd
02-25-2008 03:06 AM
Find all posts by this user Quote this message in a reply
prale Offline
Junior Member
*

Posts: 92
Joined: Feb 2008
Reputation: 1
Post: #6
RE: root account locked because of stupid move
It's found the right file after I mounted hda3.
Hope this is the correct one.
02-25-2008 03:14 AM
Find all posts by this user Quote this message in a reply
prale Offline
Junior Member
*

Posts: 92
Joined: Feb 2008
Reputation: 1
Post: #7
RE: root account locked because of stupid move
Problem solved, thanks guys!
This solution is better than reinstalling everything, and reconfiguring all ispcp accounts Wink
02-25-2008 03:27 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #8
RE: root account locked because of stupid move
prale Wrote:It's found the right file after I mounted hda3.
Hope this is the correct one.

well - seems so - there won't be several /etc on the same hard disk.

It depends on where and how linux is installed.

read something about the linux basics then you're fine.

/J
02-25-2008 03:28 AM
Visit this user's website Find all posts by this user Quote this message in a reply
prale Offline
Junior Member
*

Posts: 92
Joined: Feb 2008
Reputation: 1
Post: #9
RE: root account locked because of stupid move
Yes I know alot about php5 OOP, mysql and windows.
This is my first dedicated linux machine, and I also want to know everything about it.
So I guess i'll keep on reading available tutorials.

Thanx again for all help.
(This post was last modified: 02-25-2008 03:37 AM by prale.)
02-25-2008 03:35 AM
Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #10
RE: root account locked because of stupid move
for future problems like that. It's better to remount the root-partition read-only before rebooting...
02-25-2008 03:57 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 4 Guest(s)