Passwordless user account

  • Is it possible to create passwordless user accounts? I want to create a user for backups over SSH, and I want it to log in only with private key authentication. I have no need or desire for it to log into openmediavault web gui either.


    Is this possible, or must all accounts have passwords?

    • Offizieller Beitrag

    Is it possible to create passwordless user accounts?

    Not from the web interface. You can use useradd from the command line and if you never set a password, it won't have one. If you already created the user, just execute the following command as root: passwd --delete USERNAME

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Not from the web interface. You can use useradd from the command line and if you never set a password, it won't have one. If you already created the user, just execute the following command as root: passwd --delete USERNAME

    Excellent. passwd --delete USERNAME worked perfectly and the user can no longer log into the web gui. The other situation I can think of where a password would be used is for "sudo" but since I want to limit the capabilities of this account to making backups, I have made sure it is not in the sudo group.


    Are there potential issues to be aware of with setting accounts to be passwordless?

    • Offizieller Beitrag

    The other situation I can think of where a password would be used is for "sudo" but since I want to limit the capabilities of this account to making backups, I have made sure it is not in the sudo group.

    You can always create sudoers rules with NOPASSWD if needed.


    Are there potential issues to be aware of with setting accounts to be passwordless?

    Nope. It is safer than having a password.

  • What about SMB/CIFS shares that require username/password for access?


    I tested with a user with its account password deleted, and the SMB/CIFS share still required credentials (expected)... and accepted the "deleted" account password. How/where is this password stored and managed?

    • Offizieller Beitrag

    What about SMB/CIFS shares that require username/password for access?

    Technically, it is possible to set a password for a user for samba but not have a system password. But this would be a pain in the ass and not possible with the web interface. I would recommend using different username for shell access (like USERNAMEADMIN or USERNAMEBACKUP) and use the regular username with a password but no login for samba. The only thing in that situation that you can't do is remove the password but that is simple.


    How/where is this password stored and managed?

    OMV uses the standard Linux place - /etc/shadow - but that is an encrypted password hash and you don't want to start modifying that.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I would recommend using different username for shell access (like USERNAMEADMIN or USERNAMEBACKUP) and use the regular username with a password but no login for samba.

    Do you mean using two different accounts named similarly (USERNAME for samba and USERNAMEADMIN for logging in if necessary)? And is no login for samba achieved by selecting /usr/sbin/nologin or /bin/false for that account's shell?

    • Offizieller Beitrag

    Do you mean using two different accounts named similarly (USERNAME for samba and USERNAMEADMIN for logging in if necessary)?

    Yep.


    And is no login for samba achieved by selecting /usr/sbin/nologin or /bin/false for that account's shell?

    Yep.

  • It's still worth noting that passwd --delete USERNAME did not also remove the samba password.


    samba's passwords seem to be stored in /var/lib/samba/private/passdb.tdb and tdbdump /var/lib/samba/private/passdb.tdb shows that the system account user with its password deleted still has an entry in this file.


    In case it's helpful, /etc/samba/smb.conf contains the following settings relating to passwords:


    Code
    encrypt passwords = true
    passdb backend = tdbsam
    obey pam restrictions = no
    unix password sync = no
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    pam password change = yes

    The smbpasswd command seems to be the way to change samba passwords (or disable with -d), but I don't know what consequences this could have on OMV.

    • Offizieller Beitrag

    I don't know what consequences this could have on OMV.

    None. If you create the user with useradd, it won't add a samba password. Although, having a samba password doesn't mean the user has access to samba shares. Unless you give guest access, the user would have to have permission to access share(s).

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • If you create the user with useradd, it won't add a samba password.

    I'm still using the OMV gui for creating users. useradd was used just for making the account passwordless, but it does not change/remove the samba password.


    As far as I can tell, the OMV gui does not have a way to manage samba users or passwords.

    • Offizieller Beitrag

    As far as I can tell, the OMV gui does not have a way to manage samba users or passwords.

    Not independently anyway. Your use case is the first I have seen used on OMV. I would really use the command line if you are worried about it.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!