# Help on root login.



## concept (Dec 12, 2012)

I am on a vps server running 9.1-PRERELEASE, and I tried to upgrade to 9.1-RELEASE using svn, mergemaster corrupted my master.passwd and /etc/passwd so I have to recopy the master.passwd file from an old default copy. I believe that I have disabled root login from virtual console by changing the "secure" to "insecure" on /etc/ttys/ as a form of security and now I can't login as root. I used key-based authentication for my normal user and like I said, I have the fresh default copy of master.passwd so my users aren't there yet. Is there any other way so I can log-in as root on my virtual console?


----------



## SirDice (Dec 12, 2012)

Boot from a live CD or something like that. You can then change the tty back to insecure and restore the backup of master.passwd.


----------



## concept (Dec 13, 2012)

I'm on live CD now, I accessed /etc/ttys/ but they are all on "secure", I think it's the CD's own /etc/ttys/ how will I access my own servers ttys record?


----------



## wblock@ (Dec 13, 2012)

Mount the server's root partition, typically on /mnt.  For example,

```
# mount /dev/ada0p2 /mnt
# ee /mnt/etc/ttys
```


----------



## concept (Dec 13, 2012)

Thanks but how do I find where is my root partition? I'm on xen virtualization by the way. I'm getting

```
WARNING: R/W mount of / denied. Filesystem is not clean - run fsck
WARNING: Forced mount will invalidate journal contents
mount: ada0p2 : Operation not permitted
```


----------



## SirDice (Dec 13, 2012)

You need to fsck(8) the filesystem first.


----------



## concept (Dec 13, 2012)

Got it now, I have successfully mounted /dev/ada0p2/ to /mnt, I have edited and manually added a new user to my root partition's /mnt/etc/master.passwd and /mnt/etc/passwd but is it possible to use pwd_mkdb from Live CD? I'm getting a Read Only File problem when I run pwd_mkdb so changing my root's password doesn't do a thing, I still can't get in to my server.

What I plan to do is enable PermitRootLogin and PermitEmptyPassword first so I can login as root before I redo necessary changes again.


----------

