'df -k .' on remote server

Hi!

I need to execte 'df -k <path>' on remote server in my script and need to validate the output of that command.

i tried

ssh username@hostname 'df -k .'

but here i need to enter password externally, is there is any command i can pass username, password and hostname of the remote server

like " ssh username/password@hostname 'df -k .' "

You need to set up some SSH keys to avoid entering a password. Read the SSH docs or search for HOWTOs/FAQs for that... there are many of them.