Simulating scp through ssh

How to simulate scp command using ssh?

do you have sftp? this command will probably tell you:

whch sftp

what does the command

which scp

show?

Actually i want to set up a ssh key pair between two machines making sure that i should be asking password only once. Now problem is when i generate key pairs first i have to check if
1) if ~/.ssh file exists in remote machines. If not, create one
2) scp the public key to remote machine
3) cat rsa.pub >> authorized_keys in remote machine.

Now each of this step requires ssh/scp. Can someone tell me how to do this all by prompting for password only once.

You can sftp a keyfile this way:

sftp myusername@nodename
Password: <your pswd>
cd .ssh
put mykeyfile
exit

Once you add the pub key to the authorized_keys on the remote server you won't get a password prompt.

To test simple try

ssh user@remotemachine.

Hope that helps