Can a SSH key created by one User ID be used by other ID for SFTP? -
i new to unix scipt , sftp process. need write ksh script can transfer files sftp server. have created ssh key pairs. have developed ksh code well. every time ksh script being executed other id , prompting password when executing same not asking password though group id these 2 user ids same. below section sending files
################################################### # sftp mft ---> sftp mft ---> sftp mft # ################################################### # execute sftp command put file on mft # # $1 - ssh private key file # # $2 - sftp user id @ mft server # # $3 - source directory (to take files from) # # $4 - mft directory (to place files into) # # $5 - file mput # # $6 - mft pwd # ################################################### function sftpputtomft { sftp -o identityfile=${1} ${2} >> $sftp_log << endsftp lcd ${3} cd ${4} mput ${5} bye endsftp
opemssh refuse use key readable others. if try, similar warning below.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ warning: unprotected private key file! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ permissions 0644 '/users/xxxxxxxx/.ssh/id_rsa' open. required private key files not accessible others. private key ignored. bad permissions: ignore key: /users/xxxxxxxx/.ssh/id_rsa
hope helps.
Comments
Post a Comment