Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for sshpass #139

Closed
yurii-github opened this issue Apr 24, 2019 · 5 comments
Closed

add support for sshpass #139

yurii-github opened this issue Apr 24, 2019 · 5 comments

Comments

@yurii-github
Copy link

We need to have an option for sshpass support

@driesvints
Copy link
Member

Can you thoroughly explain why this is needed and how it would work?

@yurii-github
Copy link
Author

yurii-github commented Apr 25, 2019

the program is apt-get install sshpass. it fools ssh to be interactive and provides ability to use password instead of key in non-interactive ssh operations
sshpass -pPASSWORD ssh USER@HOST -pPORT

According to code currently it works as

                $process = new Process(
                    "ssh $target 'bash -se' << \\$delimiter".PHP_EOL
                    .implode(PHP_EOL, $env).PHP_EOL
                    .'set -e'.PHP_EOL
                    .$task->script.PHP_EOL
                    .$delimiter
                );

So, it would be nice to have an option make arbitrary command

@servers(['web' => ['user@192.168.1.1']])
do like
@servers(['web' => ['sshpass -pPASSWORD ssh user@192.168.1.1 -pPORT']])

still i'm not sure about passing command, but regular string can be passed to sshpass like
sshpass -pPASSWORD ssh USER@HOST -pPORT 'ls -la'

@driesvints
Copy link
Member

It seems unwanted to me to add sensitive things like a password to a deploy script.

@driesvints
Copy link
Member

I'm going to have to close this for now. If there are more questions coming in to support this we might reconsider. Thanks for submitting.

@yurii-github
Copy link
Author

password will be stored in environment variable. I'm using gitlab

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants