Ubuntu: Is there a log to shows any connections going out? - Ubuntu 12 [closed]



Question:

For example if someone is trying to SSH into another server or connect to another server from my Ubuntu server?

Is there a log file for this?


Solution:1

Unfortunately not by default. You can use your firewall to create one. Assuming you are using ufw:

# ufw allow out log to any proto tcp port 22  

Will log all outgoing connections to any server on tcp port 22. The location of the logfile should be /var/log/ufw.log but it might log it to /var/log/kern.log or /var/log/syslog depending on rsyslog's configuration.


Solution:2

Yes there is use the following command to check that:

sudo journalctl -u ssh  

In case the log is too long you can pipe that into tail or head depending on which part of the records you want to see:

sudo journalctl -u ssh | [tail | head]  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »