[FreeBSD] How to allow Root access on FreeBSD over ssh protocol

[FreeBSD] How to allow Root access on FreeBSD over ssh protocol

This post guides you on how to enable root access on FreeBSD because by default FreeBSD does not allow root access over ssh protocol.

So if you need to log on to your FreeBSD machine over ssh with root privilege, then you have to allow root user access for ssh login.
In this example I am using VIM as the text editor but if you don’t have VIM editor then you have to use the default EE or VI editor.

If you want to install VIM editor please have a look at the following link:
How to Install VIM on FreeBSD

To do so, You will need to edit the SSH daemon configuration file.

#vim /etc/ssh/sshd_config

Find the below line in the above file:

#PermitRootLogin no

The preceding # mark shows that this line is commented.
You just have to un-comment the line and modify the “no” at the end of file to “yes” (Of course without the quotes).
After modification the line should be looking like as following:

PermitRootLogin yes

Save the file and quit vim editor.

Now to reflect the change, you have to restart the ssh daemon by typing the following command on the console:

# /etc/rc.d/sshd restart

After the above steps if you try accessing your system from another host over ssh protocol, you must be able to login to your system.

If you need to know more on VIM commands then please have a look at the following link:
VIM commands for day to day usage

Previous [ROM] CyanogenMod 12 ROM for Motorola Moto E codename: CONDOR Android Lollipop 5.0.2
Next [ROM] CyanogenMod 12 Android Lollipop 5.0.2 ROM for Motorola Moto G 2nd Gen codename: TITAN

About author

siba 698 posts

A B.Tech degree holder with more than 5 years of experience on Embedded Systems design domain. He has worked on Aerospace domain, NAND storage, Server storage and Wireless networking.

View all posts by this author →

You might also like

FreeBSD Guides 0 Comments

How to fix E575: viminfo: Illegal starting char in line

This post guides you on How to fix E575: viminfo: Illegal starting char in line on VIM text editor. Once I was working with the VIM editor and everything was

FreeBSD Guides 0 Comments

[FreeBSD] How to install VIM editor in FreeBSD

By default FreeBSD comes in a command line user interface. As an Administrator or a Device Drive developer or as a FreeBSD user, you must be having a good text

FreeBSD Guides 0 Comments

[FreeBSD] How to Install FreeBSD OS, Step by step guide using a virtual machine

Take a deep breathe and be sure that you have at least an hour of time. We have to go a long way towards an important step. Before going into

2 Comments

  1. unixland
    March 20, 08:50

    “So if you need to log on to your system and need root privilege, then you have” to use sudo! And you should read the book “Sudo Mastery” from Michael W Lucas. Permit root login on your server is really no option.

    • Infysim .org
      March 22, 20:03

      Seems like my statement was misleading, at least for you.
      So I have updated that accordingly.

      I meant root login over ssh protocol and not system login.

Leave a Reply

Only registered users can comment.