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

use the ssh-config-file with the actual ssh cmd #979

Closed
mwr opened this issue Jan 25, 2017 · 9 comments
Closed

use the ssh-config-file with the actual ssh cmd #979

mwr opened this issue Jan 25, 2017 · 9 comments

Comments

@mwr
Copy link

mwr commented Jan 25, 2017

Q A
Issue Type Question
Deployer Version master
Local Machine OS ---
Remote Machine OS ---

Description

One can provide the server config with a configFile like this:
$production->configFile('path/to/file');

In the first place I assumed this file would then be used with the actual ssh command.
But as it turns out is just used to gather some information out of it.

So is there a reason why this is not done?

See here:
https://github.com/deployphp/deployer/blob/master/src/Server/Remote/NativeSsh.php#L51

In my local dev environment I added -i path/to/file in the above mentioned class and it worked out well.

@antonmedv
Copy link
Member

Config file is used only for getting config about servers.

@mwr
Copy link
Author

mwr commented Jan 26, 2017

Thanks @Elfet for your fast response.
OK, that's what I figured. But is there something preventing us from adding the possibility to use the ssh-config file in the command?
If not I would be happy to create a pull request to add that feature.

@antonmedv
Copy link
Member

You want to not to use config file?

@antonmedv
Copy link
Member

There actually a research #980 from me, i'm going to improve whole ssh system at deployer.

@mwr
Copy link
Author

mwr commented Jan 27, 2017

I want to use the native ssh implementaion and use the config file as a parameter.
Right now the config file is only used to fetch information.
I want to use it for the actual connection.
Thus adding the possibility to use all the features we have available in the native ssh command like ProxyCommand etc.

Like this:

    /**
     * {@inheritdoc}
     */
    public function run($command)
    {
        $serverConfig = $this->getConfiguration();
        $sshOptions = [
            '-A',
            '-q',
            '-i __PATH_TO_SSH_CONFIG_FILE__',
            '-o UserKnownHostsFile=/dev/null',
            '-o StrictHostKeyChecking=no'
        ];

And I like the approach of using native ssh :)

@antonmedv
Copy link
Member

@mwr i will implement this. All $sshOptions should be configurable.

@mwr
Copy link
Author

mwr commented Jan 27, 2017

@Elfet looking forward to that. Will be a great addition.

@antonmedv
Copy link
Member

#980

@pluseg
Copy link
Contributor

pluseg commented Feb 24, 2017

@Elfet please close the ticket as it's done.

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

No branches or pull requests

3 participants