How to setup admin user with gitlab with LDAP authentication? - authentication

I've just setup gitlab, but I'm completely lost with regards to admin user. The wiki seems silent about this topic, and google hasn't been of help either.
So, how do I setup admin users with gitlab on LDAP authentication?

You can also set admin permissions to a user by doing something like this in the rails console:
User.find_by_email("user#example.org") do |i|
i.admin = true
i.save
end

This is what I did to make a LDAP (or Windows AD) user vikas as admin.
First login on GitLab portal and logout, then run the below commands.
gitlab-rails console production
u = User.where(id: 1).first
u.admin = true
u.save!
exit
After running the above commands, login again and now your will have admin privileges for vikas AD user.

Mine is a variant of the accepted answer but it's based on an example from the official documentation
From the command line of your gitlab server:
Open the gitlab rails console (I'm assuming here that you aren't logged in as root):
sudo gitlab-rails console production
Then type the following commands:
user = User.find_by(username: 'my_username')
user.admin = true
user.save!
Close the console:
exit
Update your gitlab server:
sudo gitlab-ctl reconfigure

The file db/fixtures/production/001_admin.rb contains a user and password setup for administration, but you have to disable LDAP to login with it. Afterwards, if you have created a user by login in with LDAP, you can set it up to be an administrator and re-enable LDAP.
Hopefully, a more rational way exists...

There is a check box on web interface, if your GitLab username has admin access.
Login to GitLab, and in the context of Admin Area > Users > the.other.user > edit > Access > Access level, check "Admin".
I didn't try the Linux commands, because web GUI is more reliable. The official GitLab document about permission didn't include this setting, maybe it feels like intuitive.

Login to gitlab database and run:
update users set admin = 't' where email like 'xxxxx#xxxxx';

Related

Reset OpenStack admin password

I have installed openstack on my VM. I changed my admin password but I do not know it(I have generated via keepass, but forget to save it :( )
Now I want to change it.
stack#smaug:~/devstack$ openstack user password set --password somepassword admin
Could not recognize Fernet token (HTTP 404) (Request-ID: req-8ba5e9a3-f8df-4ef1-91ab-24e6da33ff8f)
Could you help me How to use Fernet token and How Can I change admin password?
Solved, Update:
source /opt/stack/devstack/openrc admin admin
openstack user set --password-prompt admin
Now I am able to login \o/

How to delete a user from SonarQube and re-activate?

In our SonarQube instance we have recently enabled LDAP authentication. Prior to LDAP integration the users were manually created. It so happened some of the users were created using the same LDAP user ID and custom password.
Now when LDAP is integrated we want all users use the LDAP ID/pass instead of previously manually created ID/password. SonarQube login works with manually created password rather than LDAP password. So how do remove the manually created users and only activate the LDAP users?
PS: I dont see the option to delete but only to de-activate
As replied by Jeroen Heier in comments, removing users from Administration > Security > Users will allow you to reuse the login of the removed user with an LDAP account.
If it's not the case, please describe what you're doing.
While I'm concerned with the deletion of an account... why can't you re-activate a user if you de-activated them through the UI. This is incredibly painful if a user was accidentally deactivated.

keycloak initial login does not work with admin username and password

I cannot login to keycloak in the initial setup. I managed to run the server via /standalone.sh -b=0.0.0.0 command and when accessing it via http://x.x.x.x:8080 the login page doesn't allow me to login with admin/admin username and password. any hint is highly apreciated.
In order to create the initial administrator user you need to use add-user-keycloak.sh (.bat) script located in keycloak/bin with all other scripts. Run it before starting/restarting the server, so Keycloak could pick up the user:
$ ./add-user-keycloak.sh -u admin -p password.
$ ./add-user-keycloak.sh --help will show you all the available options.
According to the latest keycloak documentation (today) there are two procedures for creating the first administrator credentials:
Creating the account on the local host
If your server is accessible from localhost, perform these steps.
Procedure:
In a web browser, go to the http://localhost:8080 URL.
Supply a username and password that you can recall in the Welcome page
Creating the account remotely
If you cannot access the server from a localhost address, or just want to start Keycloak from the command line, use the KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASSWORD environment variables to create an initial admin account.
For example:
export KEYCLOAK_ADMIN=<username>
export KEYCLOAK_ADMIN_PASSWORD=<password>
bin/kc.[sh|bat] start
If you are someone who have setup KeyCloak in Kubernetes then we can port-forward and access the localhost:8080/auth that is how I did the initial admin user setup.
kubectl port-forward svc/keycloak-http -n <namespace> 8080:80

Can't login to openfire administrator console. It always told me "make sure your username and password are correct"

I am new to OpenFire.
I have an OpenFire server on CentOS, but I'm unable to login to the admin console.
When I try, it always displays the following message:
"Make sure your username and password are correct and that you're an admin or moderator."
So far, I have tried the following:
Open openfire.xml
Reset setup by setting the setup parameter to 'false'
Restarting the OpenFire server
Accessing the admin console via browser
Select a DB to use. I selected my own database not the sample database for OpenFire.
When I tried to reset the password for admin, I was presented with the following OpenFire admin console (click to view) screen.
I can see changes in my database, but I'm still unable to log in.
I also tried modify the OfUser table directly, but I get the same result.
During the installation guide you must have setup your admin account to admin#XYZ and a password. Well at the time of the login use username as admin and password same as the one given at the time of installation.
After fresh installation, start the openfire setup in "root/administrator" account. Select all the required features in the installation. Give the password in the 'account' section carefully. After setup, you will be able to login with username as 'admin' and your selected password.

rhq default user/password - whe

I just installed latest rhq rhq-server-4.10.0,
I go into
http://myrhq:7080/coregui/
and try to login with admin and with rhqadmin and password used for database, but it doesn't work (actually not strange cause I tried with database password - not application which I don't know).
Where is user / password for
http://myrhq:7080/coregui/ defined ?
How can I login into application ?
BR,
Jakub
The default username/password after install are rhqadmin/rhqadmin as described in the "Running the server" docs.
You can then go in the UI to Administration->Users and change the password:
This is also the place to set up more users and assign them roles etc.
The later is described in the rhq wiki.