fix: use getpass instead of os.getlogin
This commit is contained in:
parent
47c3c4da7e
commit
e828f0333a
3
main.py
3
main.py
@ -10,12 +10,13 @@ from cryptography.hazmat.primitives.asymmetric import ed25519, dsa, rsa, ec
|
||||
from io import StringIO
|
||||
from scp import SCPClient
|
||||
from paramiko import RSAKey, Ed25519Key, ECDSAKey, DSSKey, PKey, SSHClient
|
||||
import getpass
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--host", dest="hostname", required=True, type=str, help="SSH-Server")
|
||||
parser.add_argument("--port", dest="port", default=22, type=int, help="SSH-Port")
|
||||
parser.add_argument("--username", dest="username", default=os.getlogin(), type=str, help="Remote Unix User")
|
||||
parser.add_argument("--username", dest="username", default=getpass.getuser(), type=str, help="Remote Unix User")
|
||||
parser.add_argument("--password", dest="password", default=None, type=str, help="Remote password")
|
||||
parser.add_argument("--identity-file", dest="identity_file", default=None, type=str, help="Path to private SSH-Key")
|
||||
parser.add_argument("--identity-passphrase", dest="identity_passphrase", default=None, type=str, help="Passphrase of the SSH-Key")
|
||||
|
Loading…
Reference in New Issue
Block a user