This commit is contained in:
Zsolt Ero
2023-12-29 16:02:54 +01:00
parent f84b4f6e3d
commit 0c5e6029c2
5 changed files with 6 additions and 22 deletions

View File

@@ -113,7 +113,7 @@ def get_username(c):
def add_user(c, username, passwd=None, uid=None):
uid_str = f'--uid={uid}' if uid else ''
# --disabled-password - ssh-key login only
# --disabled-password -> ssh-key login only
c.sudo(f'adduser --disabled-password --gecos "" {uid_str} {username}', warn=True)
if passwd:
sudo_cmd(c, f'echo "{username}:{passwd}" | chpasswd')