Set password for OMD Site user to use with SFTP?

I’m currently developing some SNMP plugins and have a question regarding the site user that you use to manage each individual site.

Is it possible to set/change the password for that user? Usually you switch to it using su - $sitename, but I would like to use the SFTP Extension for VSCode on my Windows client for development, to mount the filesystem and directly edit files remotely.

I don’t really want to use the root user for that, but the files in the site folder are owned by the site user and I also don’t want to keep using chown every time I want to test a change.

How do others here do this?

Hi,

yes, the site user is a regular user and you can connect via ssh or e.g. Visual Studio Code remote with that user to develop stuff.

1 Like

I would use SSH pubkey auth to login as site user in this case.

3 Likes

The question is how do I set the site user’s password using passwd if I don’t get the initial password, and in that same vein, how would I copy the privkey to another client If I can’t login directly to the user in the first place?

I tried copying it to /tmp/ and using chown to pull it using a different user, but that makes they key not work anymore obviously.

You will have another administrative user on your checkmk host with which you can run sudo passwd siteuser to set the password.

For the ssh key you can use ssh-copy-id <your user name>@<your_checkmk_host on your source machine if it is a linux/unix system.
Otherwise you will have to add your public key to the authorized_keys file of the site user manually.
If you google ssh private/public key authentication there is tons of how tos how to achive that.

1 Like

The Dev machine is a Windows machine, but I set the password that way, thanks! Totally forgot you could use sudo to change the password of a different user! I’m not really a regular linux user, but do know how to kinda get around :slight_smile:

I just couldn’t get ssh key auth to work though, I’ll use the password.

1 Like