ssh 3

gradle ssh plugin execute 시 오류를 무시하는 방법

너무너무너무 간단해서 쉬운 해결책이긴 하지만, 글로 남겨본다. make랑 비슷할 줄알고 @을 명령어 앞에 붙여봤지만, 소용이 없었고 더 간단했다. execute "SOME COMMANDS", ignoreError:true 뒤에 저 옵션만 붙어주면 된다. 이정도 알아봤으면, 아래의 공식 링크에 방문해서, 다른 옵션은 뭐가 있나 알아보는 것도 좋겠다. 참고 gradle-ssh-plugin.github.io/docs/#_execute_a_command

IT한 것/unix 2021.04.14

gradle ssh execute가 종료되지 않을 때

gradle ssh plugin은 아주 많은 기능을 가진 플러그인이다. 단순 ssh client라고 생각했는데, gradle-ssh-plugin.github.io/docs/ Gradle SSH Plugin Document Groovy SSH is an automation tool which provides SSH facilities such as command execution or file transfer. It is provided as the executable JAR gssh.jar and the library groovy-ssh-x.y.z.jar. gradle-ssh-plugin.github.io 참고 링크를 따라가면.. 아주 장난 아니다 어쨋든 이것을 이용하여 간단하게 개발 모듈을 deploy..

IT한 것/unix 2021.04.14

com.jcraft.jsch.JSchException: invalid privatekey

gradle에서 ssh 플러그인을 활용해서 서버에 deploy 시키기 하려고 했다. 아직 스크립트가 실행도 안되었는데, 위의 오류가 발생했다. $ ssh-keygen -f my_id_rsa 위의 명령으로 my_id_rsa 비밀키를 만들었고 task deploy { host = 'ip' user = 'username' identity = file('my_is_rsa') } 위의 설정으로 ssh를 설정했다. 위의 오류가 발생한 이유는 개인키 파일 형식이 잘못되었다는 것. ssh-keygen 기본 옵션으로 개인키를 생성하면 -----BEGIN OPENSSH PRIVATE KEY----- 로 시작하는 개인키 파일이 만들어지는데 이 파일은 OPENSSH 용 개인키라 인식을 못하는 것으로 보인다. 일반적인 PEM ..

IT한 것 2021.04.13