管道运行时,出现以下错误:
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/config
debug1: key_load_private_type: incorrect passphrase supplied to decrypt private key
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
lost connection
这是我的.yml文件:
image: maven:3.3.9
pipelines:
default:
- step:
caches:
- maven
name: Build
script: # Modify the commands below to build your repository.
- echo "Build Start"
- mvn package
- echo $BUILD_DIR
- mv target/**.jar target/transpoDirect.jar
artifacts:
- target/**.jar
- step:
name: Deploy
image: maven:3.3.9
script:
- ls -la .
- scp -i ~/.ssh/config -P 7822 -v -o StrictHostKeyChecking=no target/*.jar root@$hostName:/var/transpoDirect/.
- ssh -p 7822 -i ~/.ssh/config -v -o StrictHostKeyChecking=no root@$hostName sudo service transpoDirect restart
我尝试过的是chmod〜/ .ssh文件夹,并将文件保存到777
hostName变量是在存储库的设置中设置的。
重新生成密钥。粘贴到远程服务器的authorize_keys文件中,但仍然出现相同的错误
authorized_keys的位置:
================================================ =================
这是有效的:
这会将jar复制到远程服务器:
这将按照此处所述重新启动服务:https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html
答案 0 :(得分:1)
这是有效的:
这会将jar复制到远程服务器:
scp -i /root/.ssh -4 -P 7822 -v -o StrictHostKeyChecking =无目标/*.jar root @ $ hostName:/ var / transpoDirect/。
这将按照此处所述重新启动服务:https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html
ssh -4 -p 7822 -i /root/.ssh -v -o StrictHostKeyChecking =没有root @ $ hostName sudo服务transpoDirect重新启动
答案 1 :(得分:0)
与该SSH密钥一起使用的私钥具有密码短语,但是您并未在YAML中的任何地方指定该密码短语。您既可以生成新的密钥供Pipelines专用,也可以上传没有密码的现有密钥的副本,或者可能能够使用环境变量来提供密码