This is a program for testing SFTP connection. I created this program to monitor SFTP connectivity with Monit.
Make sure port number is specified with hostname.
git clone git@github.com:hongster/sftptest.git
cd sftptest
go mod tidy
go build
./sftptest ftp.example.com:22 userFoo passwordBar