Help using Base SAS procedures

SFTP using key encryption

Reply
Contributor
Posts: 65

SFTP using key encryption

I'm trying to send a file to a SFTP site and not having any luck. I have installed PUTTY based on some notes I found online.

Here is the code I'm using:

filename outfile sftp 'd:/temp/test.txt' host="server" user="user";

data _null_;
file outfile;
do i=1 to 10;
put i=;
end;
run;
Super Contributor
Super Contributor
Posts: 3,174

Re: SFTP using key encryption

And what's the exact error or problem symptom? Also info about SAS version, OS platform would be most helpful - even to suggest that you copy/paste the SAS log revealing the error diagnostic and your code.

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 65

Re: SFTP using key encryption

I'm running 9.2 on Windows 2003 64 bit machine. I used the document TS-800 "Configuring SSH Client Software."

ERROR: Connection refused, check key authentication and sshd server status
ERROR: Connection refused, check key authentication and sshd server status
ERROR: .
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
Respected Advisor
Posts: 4,173

Re: SFTP using key encryption

Agree with Scott.

First thing I'd do to narrow down possible issues is to manually open a sftp connection to the target server in putty. This will tell you if you can open such a connection at all with your user. It also tells you which parameters you have to pass to establish such a connection (i.e. a password).

Still in putty I would then send some test file to the destination directory to verify if the path exists and if I have write access to it.

Only if both this things work I would start investigating what could be wrong with my SAS code. Message was edited by: Patrick
Contributor
Posts: 65

Re: SFTP using key encryption

I'm able to use PSFTP and connect to the server fine.
Respected Advisor
Posts: 4,173

Re: SFTP using key encryption

2 things to add to your filename statement which might help/give you more information:

filename .... options = "Port=.." DEBUG ;
Contributor
Posts: 65

Re: SFTP using key encryption

I put the additional items in the code and the log outputs the same information.
Contributor
Posts: 65

Re: SFTP using key encryption

Could it be an issue where SAS can't resolve the Private Key? Do I need to have the key in a special location for SAS?
Respected Advisor
Posts: 4,173

Re: SFTP using key encryption

I would suggest you open a track with our friends from SAS Tech Support and provide them with as much information as you have.
Ask a Question
Discussion stats
  • 8 replies
  • 1217 views
  • 0 likes
  • 3 in conversation