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

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


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:
Installing VIM editor 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 [How to solve] Could not load host key: /etc/ssh/ssh_host_rsa_key issue in FreeBSD or Linux
Next [FreeBSD] How to install VIM in FreeBSD

About author

Sibananda Sahu
Sibananda Sahu 136 posts

A Linux Kernel Developer and a Firmware Developer by profession. Have worked with few big companies: BROADCOM Corporation, Cypress Semiconductor, LSI Corporation, TOSHIBA Corporation, Western Digital; on various cutting edge technologies and product lines, such as: RAID storage Driver, SSD Firmware, WLAN Firmware etc. Having more than 9 years of experience in Software Engineering domain. Now, took a pledge to educate all aspirant students to teach about Linux Kernel Development.

View all posts by this author →

You might also like

FreeBSD Topics 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

FreeBSD Topics 0 Comments

[FreeBSD] How to install ports collection manually in FreeBSD

This post was last updated on June 23rd, 2020 at 08:05 pmAs an Administrator or a Device Drive developer you may need some utilities on the go to work in

FreeBSD Topics 0 Comments

[FreeBSD] How to set and unset loader variables in boot loader prompt

This post was last updated on February 17th, 2019 at 06:08 amImportant question is why you need to set and unset variables at boot time???The answer is when something is


No Comments Yet!

You can be first to comment this post!

Leave a Reply