DATA Step, Macro, Functions and more

Encoded passwords & SAMBA

Reply
Frequent Contributor
Frequent Contributor
Posts: 139

Encoded passwords & SAMBA

Hello all-  

So we have a macro that takes the username and the encoded password from the ADauth domain from the login manager that we can use to use the PC fileshare to access Excel files on the windows drive when necessary (and often)-  that works just fine and reduces need to store passwords in source code or  home folders. 

 

Next step though is the SAMBA script. Currently we save  a credential file on our home folder and then a x command executes off that file- Unlike the PC fileshare, the SAMBA password cannot be encrypted insofar as I can tell.  I am attempting to write a pass through as many of our developers have had difficulties simply storing this file and if the spacing/carriage return on the text file isn't just right it doesn't work either. Also it allows for easier  transfer of running programs between developers. 

 

Script works below for the credential file for SAMBA-any advice on using an encoded password-TIA 

 


%let put_subfolder=/xxx/_USERDIRS/test/in;
%let linux_path=/apps/sas/datasets/data137/NCQOS/dev/nc_qos_sandbox/data/out;
%let linux_home=/home/&_METAUSER;
%put &linux_home;

data _null_;

app="/usr/bin/smbclient";
put_path="//xxx.xxx.xx.org/PnS_WEBS1_Share01";
nuid_cred="&linux_home/cs3.txt";
mput_cmd='mput *.*;';
length command $ 300;

command= catx(' ',app,put_path,'-A',nuid_cred,'-c','"prompt;',"cd &put_subfolder;", "lcd &linux_path;", mput_cmd ,'; exit;"' );
call symputx ('ftp_cmd', command);

run;

x &ftp_cmd;

 

Ask a Question
Discussion stats
  • 0 replies
  • 201 views
  • 0 likes
  • 1 in conversation