signup
[Link]'s100%free.
Howtosendpasswordusingsftpbatchfile
I'mtryingtodownloadafilefromsftpsiteusingbatchscript.I'mgettingthefollowingerror:
Permissiondenied(publickey,password,keyboardinteractive).
Couldn'treadpacket:Connectionresetbypeer
Whenrunningthecommand:
sftpb/home/[Link]<user>@<serverip>:<folder>
the
[Link]
includesthesedata:
password
lcd[localfolder]
cd[sftpserverfolder]
get*
bye
Note:It'sworkingwhenrunningatthepromptas
sftp<user>@<serverip>:<folder>
ButIneedtheabilitytoenterthepasswordautomatically.
batchfile passwords sftp
editedJul16at16:17
askedJul31'12at10:33
Pi
8,302
judith
17
63
129
145
14
1 Isitworking,byremovingthepasswordfromthebatchfile?Doestheremainingfunctionalityworkwell,by
enteringthepasswordmanually?mtk Aug1'12at8:03
Storingthepasswordinplaintextinafileisobviouslynotsecureifyoudon'twanttotypeinapassword
everytimeIstronglysuggestusingRSAkeyauthentication.lindheNov1'14at0:15
4Answers
You'[Link]:
sshpasspYOUR_PASSWORDsftpoBatchMode=nobYOUR_COMMAND_FILE_PATHUSER@HOST
Obviously,it'[Link]'simpossibletodo,
forwhateverreason.
answeredFeb1'14at4:56
JoeVanDyk
3,222
30
Thankyou![Link]'ssimplynot
possibletogetakeyfile.jbrownApr29at14:40
Ifyouaregeneratingaheapofcommandstoberun,thencallthatscriptfromaterminal,youcan
trythefollowing.
sftplogin@host</path/to/command/list
Youwillthenbeaskedtoenteryourpassword(aspernormal)howeverallthecommandsinthe
scriptrunafterthat.
Thisisclearlynotacompletelyautomatedoptionthatcanbeusedina
cron
job,butitcanbe
54
login
tour
help
stackoverflowcareers
Signup
usedfromaterminal.
answeredFeb6'14at0:47
Tigger
2,567
14
20
[Link].
Themanualclearlystates:
[Link],itis
necessarytoconfigurenoninteractiveauthenticationtoobviatetheneedtoenterapassword
atconnectiontime(seesshd(8)andsshkeygen(1)fordetails).
[Link]'llbeabletorunabatch
script.
[Link].
editedJul21'13at1:04
answeredJul21'13at0:58
akond
7,195
16
36
Youmentionbatchfiles,amIcorrectthenassumingthatyou'retalkingaboutaWindowssystem?
Ifsoyoucannotusesshpass,andyouwillhavetoswitchtoadifferentoption.
Twoofsuchoptions,thatfollowdiametricallyoppositephilosophiesare:
psftp:commandlinetoolthatyoucancallfromwithinyourbatchscriptspsftpispartofthe
PuTTYpackageandyoucanfindithere
[Link]
[Link]:ascriptableFTP/SandSFTPclientforWindowsthatallowsyouto
storeyourpasswordinencrypted"profilefiles"checkitouthere
[Link]
Eitherway,switchingfrompasswordtoPKIauthenticationisstronglyrecommended.
editedMay18at16:55
answeredOct12'14at16:12
FjodrSo
66