SCP transfer a file from localhost to a sftp server through php script

请求翻译

Hi Trying to send a file to another server using scp.. cannot use sftp as it is not installed on my server so i am getting a function not found for ssh2_connect.

So my only option as i can see it is scp. Now the problem come with i cannot include my password in the php scp script.

ie:

scp filename username:passwor@server:filename

It gives me the error that the server username doesn't exist If i use it without the password

scp filename username@server:filename

it prompts me for password

PS: I am testing the script in a command line on the localhost first as to get the error messages.

Any advice?

TA

2个回答