-
If you want the password prompt to go away then use key based authentication (described here).
-
To run commands remotely over ssh you have to give them as an argument to ssh, like the following:
root@host:~ # ssh root@www ‘ps -ef | grep apache | grep -v grep | wc -l’