- This means changing the default behavior of not allowing the Root login (only with) -> allowing the root login

more info

* The default for the sshd_config(5) PermitRootLogin option has
changed from "yes" to "prohibit-password".

* PermitRootLogin=without-password/prohibit-password now bans all
interactive authentication methods, allowing only public-key,
hostbased and GSSAPI authentication (previously it permitted
keyboard-interactive and password-less authentication if those
were enabled).

With that configuration you cannot login in as root with a password. Use keys instead.

2. change "#PermitEmptyPasswords no" to "PermitEmptyPasswords yes" as in your case root does not have any password

Monday, July 3, 2017

A lot of applications use logging as a way to store information about performed operations. Such data is very useful when you have to diagnose an issue. Logging could be done on many ways, but sometimes it’s just easier to use an existing solution. I’d like to introduce one of many libraries for logging, but quite powerful – log4net.

Get log4net

Let’s create a console application – log4netTutorial. Next you have to reference log4net library. The easiest way is to install NuGet package:

log4net appenders

Console appender

Finally, you have to define where to put messages. In log4net there is a concept of appenders to which messages are appended. In the rootnode you can add appender-ref node with ref attribute which contains the name of appender to use. For example MyAppender.

Rolling file appender

There is one last very useful appender that I can recommend. Let’s assume that your application has to log a lot of messages, maybe 10’s of MB a day, maybe more. After few weeks of using your application might consume few GBs. This might be a case that you don’t want to have. Maybe it would be better if you could keep only a piece of that – the most recent one? log4net can help with that as well – there is a concept of rolling log. Rolling file has a maximum size defined. When the size is reached the file is backed up and new one is created. There is also defined a number of backups to keep.