-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwinscp_key_update.txt
38 lines (31 loc) · 971 Bytes
/
winscp_key_update.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# title :winscp_key_update.txt
# description :WinSCP script to setup SSH key access remotely
# author :zdenek polach ( https://github.com/polachz )
# date :05.02.2017
# version :0.1
# usage :Invoked by ssh_key_upload.bat
# -------------------------------------------------------------------------
# MIT license - see the set_ssh_key_access.sh file
# -------------------------------------------------------------------------
# Connect to SFTP server using a password
open sftp://%WINSP_SSH_PARMS%
option transfer ascii
cd
#upload key file - do not fail if not exist
option batch continue
put ssh_pub_key
#reset continue option
option batch abort
# Upload the script
put set_ssh_key_access.sh
# Make it executable
chmod 755 set_ssh_key_access.sh
#now call the script
call ./set_ssh_key_access.sh
#make cleanup
option batch continue
rm ssh_pub_key
option batch abort
rm set_ssh_key_access.sh
# Exit WinSCP
exit