ssh: add --user and --host argument
Extra arguments to allow quickly overriding the username and ip address for the ssh call. Just in case you're connecting over wifi instead of 172.16.42.1
This commit is contained in:
parent
ebdd8bf111
commit
e1c4eb1ade
1 changed files with 4 additions and 2 deletions
6
ssh.py
6
ssh.py
|
@ -4,8 +4,10 @@ from logger import setup_logging, verbose_option
|
||||||
|
|
||||||
|
|
||||||
@click.command(name='ssh')
|
@click.command(name='ssh')
|
||||||
|
@click.option('--user', prompt='The SSH username', default='kupfer')
|
||||||
|
@click.option('--host', prompt='The SSH host', default='172.16.42.1')
|
||||||
@verbose_option
|
@verbose_option
|
||||||
def cmd_ssh(verbose):
|
def cmd_ssh(verbose, user, host):
|
||||||
setup_logging(verbose)
|
setup_logging(verbose)
|
||||||
|
|
||||||
subprocess.run([
|
subprocess.run([
|
||||||
|
@ -16,5 +18,5 @@ def cmd_ssh(verbose):
|
||||||
'UserKnownHostsFile=/dev/null',
|
'UserKnownHostsFile=/dev/null',
|
||||||
'-o',
|
'-o',
|
||||||
'StrictHostKeyChecking=no',
|
'StrictHostKeyChecking=no',
|
||||||
'kupfer@172.16.42.1',
|
f'{user}@{host}',
|
||||||
])
|
])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue