Creating multiple users from a spreadsheet

What is the problem?

I'm fairly new to Octoprint and would like to know how you solved this problem. I would like to create several users for my students. To give you an idea, there would be about 40 students and I would like to create different users with a specific Octoprint profile, from a spreadsheet. Do you know if this is possible and how could I solve it?

Would it be an alternative to add these users in users.yaml file?

What did you already try to solve it?

I tried to create users from users.yaml file but it failed. If it is possible I would like someone to explain to me how to do it step by step.

Have you tried running in safe mode?


Additional information about your setup

OctoPrint version 1.10.1, Ender 3

I just copy/pasted my user.yaml and removed the admin lines. Worked fine. Use nano or pico on the pi or notepad++ on Windows(that is supposed to keep the unix format). I would make a 'sample' student profile with a password like 'temporary' and use that as a template. You will have to set all the passwords after you get them loaded tho.

I would probably batch it. Not super familiar with that on linux, but the command lines would be like this.

source ~/oprint/bin/activate
octoprint user add --password <user_password> <username>

to see all the relevant options you can run this for assistance.

source ~/oprint/bin/activate
octoprint user add --help

This works, thanks you for your answer. But I do not want to do it manually. With those command lines I need to do one by one. Or is it possible to automate?

@CmdrCody would probably be a better person to answer this in linux, but personally I would just use the spreadsheet to generate the command lines. First column is octoprint, second column is user, thirst column is add, fourth column is --password, fifth column is the password to set, sixth column is the username. Save that as a space delimited text file (or tab and then use find and replace to swap tabs to spaces) then just copy paste the rows from the txt file through to SSH after running the source command first.

This might be helpful...

That worked! Thank you @jneilliii