EK
Size: a a a
EK
j
sshpass
key1:php7.2:
# - apt-get update
stage: key1
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- 'which sshpass || ( apk add sshpass )'
- 'which expect || ( apk add expect )'
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- eval $(ssh-agent -s)
- ssh-add ~/.ssh/id_rsa
- ssh-keyscan -H 'inabs.com' >> ~/.ssh/known_hosts
- ssh-keyscan inabs.com | sort -u - ~/.ssh/known_hosts -o ~/.ssh/known_hosts
- rm -rf .git
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- sshpass -p "putty123" ssh root@182.141.12.33 "ls"
j
k
key1:php7.2:
# - apt-get update
stage: key1
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- 'which sshpass || ( apk add sshpass )'
- 'which expect || ( apk add expect )'
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- eval $(ssh-agent -s)
- ssh-add ~/.ssh/id_rsa
- ssh-keyscan -H 'inabs.com' >> ~/.ssh/known_hosts
- ssh-keyscan inabs.com | sort -u - ~/.ssh/known_hosts -o ~/.ssh/known_hosts
- rm -rf .git
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- sshpass -p "putty123" ssh root@182.141.12.33 "ls"
SSHPASS='my_pass_here'
АА
RI
S
$ mkdir -p ~/.ssh
28 $ echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
29 $ chmod 700 ~/.ssh/id_rsa
30 $ eval $(ssh-agent -s)
31 Agent pid 26
32 $ ssh-add ~/.ssh/id_rsa
33 Enter passphrase for /root/.ssh/id_rsa:
34 ERROR: Job failed: exit code 1
АЛ