Hi I'm building openssh from source. From source primarily because, I want to collect more logs than what openssh already writes in /var/log/auth.log
file.
In one of the c files of the source directory, I am trying to print some values to my personal file as follows
FILE* fp = fopen("/home/raghu/openssh/my_log.log", "w");
fprintf(fp,"username: %s,password:%s, ipaddr:%s, port:%d", authctxt->user, password, get_remote_ipaddr(), get_remote_port());
Now , when I rebuild 'sshd' from source and try to connect to server with valid/invalid credentials, it says 'Connection closed'.
Any idea, why this is happening? I don't see any logs too in syslog and auth.log. Is there a better way to write to a custom file?