pyinfra icon indicating copy to clipboard operation
pyinfra copied to clipboard

Improve SSH connector documentation

Open Fizzadar opened this issue 3 years ago • 4 comments

Also some other probably useful bits:

  • SSH config support
  • forward agents
  • preserving sudo env for git clone w/agent/similar

Fizzadar avatar Dec 16 '22 08:12 Fizzadar

it is weird now that doc dosen't even specifiy how to specify login user I tried pyinfra [email protected] deploy.py and it won't work. How to add username in the inventory?

v3ss0n avatar Feb 08 '23 09:02 v3ss0n

@v3ss0n it seems you can do something like this: pyinfra 127.0.0.1 deploy.py --user deploy --key ~/.ssh/id_ed25519

But indeed I'm having a very hard time with the documentation as well. Found the --user and --key logic frome some random example.

madisvain avatar Mar 14 '23 20:03 madisvain

But how to specify a different user for each host? Is that even possible?

copernico avatar Apr 13 '23 13:04 copernico

But how to specify a different user for each host? Is that even possible?

In v3 you can do:

app_servers = [
    ("app1", {"ssh_user": "user1"}),
    ("app2", {"ssh_user": "user2"}),
]

source, source.

mmoya avatar May 28 '24 11:05 mmoya