configure ssh to avoid password prompt when I cannot access remote .ssh directory

Ask the administrator of that remote server to enable public key authentication for you. Because public key authentication needs to be supported both server side and from the client, you can't force it from the client alone.

For scripted access sshpass is a possible solution. That allows you to store your password in a file to automate logging in when you can't use key based authentication.

https://www.redhat.com/sysadmin/ssh-automation-sshpass is a useful resource for that.