Tuesday, July 27, 2010

How to Login as 'root' in Vyatta?

By default root login in vyatta 6.0 is not enabled. To login as root you have enable the user first. To do so login through user 'vyatta' with the password you set during installation.


vyatta login: vyatta
Password:
Linux noc 2.6.31-1-586-vyatta #1 SMP Fri Mar 19 12:15:52 PDT 2010 i686
Welcome to Vyatta.
This system is open-source software. The exact distribution terms for
each module comprising the full system are described in the individual
files in /usr/share/doc/*/copyright.
Last login: Tue Jul 27 14:34:09 2010

Go to configuration mode by typing
vyatta@noc# configure

Now type the following command to enable the root user
vyatta@noc# vyatta set system login user root authentication plaintext-password
Note : With this command you can create any user. Just replace 'root' with your desired user name.

Now logout from the system and this login with the user name 'root'.
vyatta login: root
Password:

Linux noc 2.6.31-1-586-vyatta #1 SMP Fri Mar 19 12:15:52 PDT 2010 i686
Welcome to Vyatta.
This system is open-source software. The exact distribution terms for
each module comprising the full system are described in the individual
files in /usr/share/doc/*/copyright.
Last login: Tue Jul 27 14:53:59 2010

At this point you cannot access the system remotely. From the ssh server direct root login is disabled. To access the system remotely you have to change the ssh configuration file.
noc:~# vim /etc/ssh/sshd_config

Look for the line 'PermitRootLogin' and replace 'no' with 'yes'. So finally it will look like
PermitRootLogin yes
Seve & exit the file.

Restart the ssh server with the following command.
noc:~# /etc/init.d/ssh restart

Note : Enabling root login through ssh is very dangerous. Don't enable unless it is really necessary. If you have to do so then make sure to impose maximum security. You can configure TCP Wrappers, DenyHosts etc. This is especially important if your router is in production environment.

No comments:

Post a Comment