List of recipes to debug or just do what you need on MAC or LINUX machine.
I found this Stackoverflow question.
lsof -i tcp:8018
display a table like that
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEnode 2091 slucas 21u IPv4 0x55f00507a74a3aa5 0t0 TCP *:4506 (LISTEN)
To kill the process
kill -9 2091
cat ~/.ssh/id_rsa.pub | ssh email@example.com "cat >> ~/.ssh/authorized_keys"
authorized_keys is file that list all authorized keys in the remote server.
for root login check that
PermitRootLogin without-password is set in you sshdConfig file