[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

I am an embedded software engineer by profession and an advanced Android user who knows a little more than many out there. I work on creating and promoting GCam APK which is a modified APK done to get several extra features on the stock app in Android. Basically this is done using reverse engineering the original app file. I work on publishing about GCam APK Port, custom ROMs and some Linux how-to guides. I use this YouTube Blue APK and the NewPipe APK as a daily Youtube apps.

Share this

Related Posts

Previous
Next Post »

2 comments

comments
20 March 2015 at 13:50 delete

"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.

Reply
avatar
23 March 2015 at 01:03 delete

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.

Reply
avatar