Create account without login Rancher UI

Hi , i am new to Rancher , i wonder if any solution to create a user account in Rancher without login web UI. For example , can i create account with a scripts or a yaml file ? (use command kubectl apply -f )

Thanks.

At my work, I create everything related to a rancher with Yaml (CRD of cattle/rancher).
With users we handle; differently, we don’t create users. We connect Rancher to SSO (Azure in our case), so we don’t need to deal with the creation of users/passwords.
Do you want to create local users, I assume?

Yes, i want to create users local.

If you have a valid token, you can use Terraform.

I recently created a clusters with local users for a demo and it works quite well.

https://registry.terraform.io/providers/rancher/rancher2/latest/docs/resources/user

Yeah , thanks for your reply . I think i’ve figured out a way to do it , you can use Rancher CLI .

I am also eager to explore its capabilities and optimize my workflow. Currently, I’m seeking a solution to create user accounts in Rancher without having to log in through the web UI manually. I wonder if there is a way to achieve this by using scripts or a YAML file and applying it with the “kubectl apply -f” command.

Yes ,you can create a local User with yaml file using “kubectl apply -f” command , this only work when you run the command on local cluster where the Rancher app is running.

I’ve a problem while trying to register nodes. I’ve followed the official documentation, and I’m using the rancher-agent container to register my nodes. However, every time I run the command, I get an error message saying, “Failed to register node: connection refused.”