Gitlab password reset in rails - ruby-on-rails

I'm trying to login to the web panel of my forgotten gitlab install but somehow the password is not working. I have tried to reset it in the console by the following
sudo -u git -H bundle exec rails console production
user = User.where(email: 'myemail#mail.com').first
user.password = 'password'
user.save
and i can confirm that a new encrypted password was set in the user table of the database, but still i cannot log in.
Using gitlab 6 on ubuntu.
What else could i do to reset the password or find out why i cant login.

You need to save the password confirmation too:
user = User.find_by(email: 'admin#local.host')
user.password = 'secret_pass'
user.password_confirmation = 'secret_pass'
user.save!
(Exclamation point is important)

As Philipp Antar pointed out, you have to use user.save! to persist the record in the database.

Edit: Environment: Gitlab Omnibus installed on Debian Jessie (SmartOS LX image)
I would have preferred to say this in a comment but I don't have enough reputation (after many years of being a ghost on the internet I'm starting to talk)...
I found this thread while trying to deal with this issue (I had installed Gitlab, played with it for a few days, and then moved on to installing other things and forgotten the credentials for my user account)(I had also forgotten that there was a 'root' account). My initial searching led me to basically these same instructions (Gitlab official docs for resetting root password: https://docs.gitlab.com/ee/security/reset_root_password.html ).
Using them I was immediately able to reset the password for the root account and login but when I performed the same steps to access my (non-root) user account it didn't work. I performed the steps three times (it's hard to miss an exclamation point when copy/pasting and I could scroll up in the console and SEE that I did it correctly, but I always want to be sure).
In the end I reset the gitlab machine and the new password for my user account then worked. For anyone who has tried this and had it not work, I suggest a reset.

Related

Neo4j Desktop 1.3.8 : "Failed - not a valid password" after using 'Reset database password'

From the desktop application I went to database>manage>administration.
There I filled in a new password (I tried several) and pressed 'apply'. After restarting the database I get the following prompt: Local Graph password has been changed. Please enter Graph password:. When I fill in the new password (I also tried the default, neo4j) I get this error... Failed - not a valid password.
I can still run the database with dbms.security.auth_enabled=false, but I just want to figure out how to get this fixed. I tried all sorts of solutions. If someone could help me set this up correctly that'd be very much appreciated.
edit note: Everything worked the previous days. After the last pc restart it suddenly didn't anymore.
I asked this question on the neo4j forum (here) and got a response from wookiefrits with the following instructions:
Disable authentication in your settings by setting:
dbms.security.auth_enabled=false
Then all you have to do is to go to your Neo4j Browser and paste this into the shell:
ALTER USER neo4j SET PASSWORD 'mynewpassword';
set dbms.security.auth_enabled back to true
I found a fix for this. I just used the change password via cypher-shell and everything synced back up again.

Jenkins "Create User" fails on Mac OS X High Sierra

Short Summary: The "Create User" form in Jenkins does nothing.
NOTE: I checked other posts related to creating and administering users and saw nothing that clearly describes or solves this problem.
OS = Mac Powerbook OS X 10.13.3 (High Sierra).
First, I installed Oracle Java JDK 8, as specified on the Jenkins installation page.
java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
Then, I installed Jenkins, as specified on the Jenkins installation page. (I installed it on localhost/8081, according to directions, because 8080 was already in use.)
Following the directions, it takes me to a screen for "Create First Admin User", as follows...
I entered data to create a new administrative account and selected the "Save and Continue" button. NOTHING HAPPENED. In other words, hitting the button did nothing and kept me on that page.
To get past it, I simply hit the "Continue as admin" button. This allowed me to continue the installation successfully.
After the installation was complete, I went to the "Create User" page with the intent of creating new users.
I entered the new user information and, again, NOTHING HAPPENED. No matter how many times I enter user data (or different user data), nothing happens.
I also shut down Jenkins and relaunched it but nothing happens.
Maybe I'm wrong but it seems that the "Create User" problem is somehow related to the "Create First Admin User" issue.
MY QUESTION: How would I fix this issue in Jenkins on Mac OS X High Sierra so that I can create, both, new administrative and general users?
Couldn't be You use non alphanumeric/underscore/dash symbols in newly created username?
I have one Jenkins ver. 2.147 installation where I had problem exactly as You described it in second step. BTW, users created in same installation before upgrade to this version contains "." in username without problems.
Found this during investigation - enabled self registration, tried to create user with "." and got error message. Same error message does not appear in management dialog screen shown above
SOLUTION: This took forever to figure out because there are no error messages or even events in any of the logs. It turns out that when you create the new user, in addition to providing Username, Password, and Full Name, you absolutely MUST provide a full E-mail address "x#y.z". It appears that it doesn't even have to be a real E-mail address (although I would advise against providing a fake E-mail address). If you do not provide an E-mail address, hitting the "Create User" button does absolutely nothing, making it difficult to understand what went wrong. The screen does not change, at all. You get no dialog warnings or errors. You get no info in any logs (Jenkins or System), which is what made debugging this difficult.
I had the exact same problem on my mac.
I solved it, after days of useless attempts.
First let me tell you the following discover in my attemps:
If during installation, I DO NOT add plugins ( manual select plugins and then select None ), The User creation WILL WORK.
HOWEVER as soon as I start adding necessary plugins later (like "git" for example or many others) the problem reappears.
Anyway the solution for me was to add a proper email in the last requested field.
Also remember to use only alphanumeric.
If this still does not work there is a sure workaround:
from command line go to Jenkins/Home/users.
copy your admin user ( cp -a admin your_new_user )
restart jenkins
Your new user is created, change from jenkins its credential.

How to reset a user password for Icinga-web version 1.8.4

I am running Icinga with Classic UI, but an year ago I added the Icinga-web as well.
I have tested a couple of things with it and left it behind.
Now I want to access it, but I don`t remember what were the credentials.
Is there a way to reset the password or to create a new username and password for it?
Thank you in advance.
Depends how you've installed Icinga Web 1.x in the first place. The sources contain a make parameter to safely reset the root user's password.
https://docs.icinga.com/latest/en/icinga-web-scratch.html
make icinga-reset-password
If you are using Debian packages, you can reconfigure the package:
dpkg-reconfigure icinga-web

Jenkins: password reset?

Plenty of guides to be found but its not working for me, the most basic solution is to set useSecurity to false and restart jenkins and thats it.
Well ok, then what? I can't change my password:
/user/[name]/configure says:
Credentials
"Credentials are only available to the user they belong to"
The key provided for logging in as admin also doesnt work anymore, since i created the first user.

gitorious install won't login

I have installed a copy of Gitorious on my own server. Everything so far seems to be okay except the fact I can't login. Any attempt to login(with correct credentials), from multiple browsers, just throws me back to the main page. Logging in with wrong password will just clear password box. What could be causing this?
I found the issue resolution here:
http://groups.google.com/group/gitorious/browse_thread/thread/e377597c0cd774b7
I had to change my host in config from localhost to my domain name.

Resources