Hello,
I have reset my password for root and user,
i can log in the terminal on the server with the root and user password logins.
BUT when i go to access the web UI i can not.
i can access the web UI but when i try to log in it says “incorrect login”
@xhp welcome to the Rockstor community.
a couple of questions for you:
Which version of Rockstor are you running?
this is specifically for the users named: root
and user
? Or is user
the username used for normally logging into the WebUI?
Regardless, the user
you’re mentioning is the one you defined during the initial setup (in the WebUI)?
By default, the root
user is not designed, nor enabled, for logging into the WebUI.
there are two users , one is ‘user’ and the other is ‘family’ and ‘root’ so i used the recovery Rescue live image to reset the password for all three of them , and so now i am able to log into the server with all three of the users, root, user, and family. i have done all the updates to the system after that also, updated from 15.4 to 15.5 then to 15.6 , and did updates… (even before the updates i was not able to log in to the WebUi thats why i did the updates to see if that would help)
BUT when accessing the WebUI i can not log in with any of the usernames
i am able to access the files from the network share using the user login
but not the WebUI
ok, that is indeed strange. The permission to log in via the WebUI is stored in the Rockstor database I believe.
Via the command line can you check the “admin” flag for the respective users? For example:
psql -U rocky -d storageadmin -c "SELECT * FROM storageadmin_user WHERE username = 'user';"
the database password is rocky
or to pull all of the users created via WebUI/owned by Rockstor:
psql -U rocky -d storageadmin -c "SELECT * FROM storageadmin_user;"
I believe, the admin
flag needs to be t
(for true
) for the user to be allowed to log in via the WebUI.
ok, looks like only the user family
is allowed to login using the WebUI.
let’s check whether the uid/gid/groups stored in the database are still the same as what the OS shows:
id family
If that matches the 1000/100/1
combo that’s in the database, can you maybe reset that password again, using the command line (without using the rescue CD) and see whether that will work now?
ok, so that’s matching.
Can you try to reset the password for the family
user, once more from the Rockstor command line?
i used the command passwd family and reset the password , verified it by logging in to the server with it and then exit back out . then i went to the computer and access the WebUI but it still says incorrect login…
the last post it says groups 100, should it be just 1 instead of 100???
Yes, I think you are correct, sorry, I think I just read over that and concluded they were the same.
So, maybe assigning family to group 1 via the command line could do the trick, easier than hacking the database …
how do i assign it group 1 … and what if i want to give the user ‘user’ to have the WebUI access can i do that with command?
Looking further into the coding, the goup_id
does not refer to the group
that Linux uses to show assignments. It’s actually the foreign key to yet another table in the db.
run this query:
`psql -U rocky -d storageadmin -c “SELECT * FROM storageadmin_group;”
and see what the id
1 in that list maps to.
So, the mapping to GID 100 might already be there. If that’s the case, then I am fresh out of ideas.
P.S.:
In general, this is how you add a group, if the need arises
usermod -a -G examplegroup exampleusername
ok , i did what you said and here are the screenshot, could you please tell me how to make the user “user” an admin, because i think maybe there is something wrong with the account “family” , if we can make the user “user” an admin i think the WebUI will work.
please let me know the command to make the user an admin
Well, I am still not sure that flipping this flag will take care of the problem. As you, I am continuing to learn on this.
investigating the user process in Rockstor. there are two “levels” if you will.
The user that is created under Linux (which we investigated) is only one component. If a user has been flagged to be allowed to log into the WebUI, it means a corresponding user is created for the WebUI application, i.e. a django user, with django being the web framework that’s being used for the Rockstor appliance.
That information is stored in the django related table auth_user
, with its encrypted password.
For reference, here’s the code snippet that takes care of creating that user when the WebUI (aka “admin”) box is checked during user creation.
You can check, which django users (aka authorized to log into the WebUI) by executing:
psql -U rocky -d storageadmin -c "SELECT * FROM auth_user;"
So, likely because you not only changed the root
user password (which is never allowed to use the WebUI, hence doesn’t have a corresponding django user), but also the others (family
, user
) the passwords got out of sync.
I believe, the way to fix this is to synchronize the passwords for user family
:
cd /opt/rockstor/src/rockstor
poetry run python manage.py changepassword family
Change the password to the one you have assigned to the family
(Linux) user. This should have these passwords sync’d up again.
Now try to log into the Web UI with that user.
If that works you can use the WebUI by adding the WebUI flag to the user
user (you will have to type in the password in again, or a new one), which should automatically harmonize the django and Linux user.
I tried this on my test machine and that seems to work.
i did this :
cd /opt/rockstor/src/rockstor
poetry run python manage.py changepassword family
and i change the family password to the same one i changed to using the command passwd and it WORKED !!!, i am now able to log in to the WebUI using the family login …
when i ran the above command it gave a message ‘You have 7 unapplied migrations…’
do i need to worry about this migration message ?
Glad to hear this worked!!!
As for the unapplied migrations, I think that’s a question for @phillxnet.
In any case, can you go into the same directory and execute this command to list all migrations:
cd /opt/rockstor/src/rockstor
poetry run python ./manage.py showmigrations
and for good measure this:
poetry run python ./manage.py showmigrations | grep '\[ \]'
sorry, my mistake, I updated the above commands to include the poetry run
portion
the first command gave a list but it went past the screen , i dont know how to show per page , but here is what it shows
very strange to me. Have to see what @phillxnet or @Flox can surmise. I would have expected that during any of your installations/upgrades those predecessor migration had already been applied. So, not sure w
since you’re not using PuTTY to connect into remotely into terminal (where you could scroll up and down and copy/paste stuff), you can add
| more
to then scroll screen by screen, so e.g.,:
poetry run python ./manage.py showmigrations | more
But I think you’re screenshots already tell a story, just not sure what it is …