I think I have locked myself out of my VM.
I have access as a low priv user I have created but the user can't sudo.
When I do SSH->Open in browser window I get a promp asking for a password which I have never set.
Any way to reset root password from the GCP Console?
Thanks, Pavel
To reset a root password for your GCP VM you need to grant appropriate IAM roles to your user to use sudo command. There is a similar post here. You can use the command 'sudo passwd' to change the password as suggested in that post.
Answering yout question you could simple run sudo commands using a startup script as the script would run as a root user, and then add your user in sudoers with sudo usermod -aG sudo, reference.
However, you could add a IAM role to your user in order to have admin access to a GCE VM, for example the roles/compute.instanceAdmin.v1, reference.
Related
I've been trying out all solutions mentioned in google for this problem to no avail. This website is built using bitnami wordpress stack in AWS. All I want to do is to log slow query. I only have wp-config user credentials to login in to mysql. But with this access I cannot run SET GLOBAL slow_query_log = 'ON';
as it requires super user privilege.
To my understanding, unless I login as root user and assign the privilege to this user or run the command as root user itself no other workaround to get this sorted.
Problem is, no password for root. Maybe it's configured without password when it was first installed (mysql).
I checked this file for password but found none.
/opt/bitnami/mysql/my.cnf
I can't view the mysql log too (permission denied)
/opt/bitnami/mysql/data/mysqld.log
I dont find the password in aws->instance settings -> get system log
I tried resetting password as mentioned here. https://community.bitnami.com/t/unable-to-reset-mysql-root-password/44360/3
mysql stops but stuck at starting in safe mode forever usin below commands:
$ sudo /opt/bitnami/ctlscript.sh stop mysql
$ sudo /opt/bitnami/mysql/bin/mysqld_safe --skip-grant-tables
How do I enable the slow query log now or get root password or reset it?
Hi Bitnami Engineer here,
The root's password of the database is the same one the instance configures for WordPress during the boot process. That means that if you have not changed the WordPress' admin password, both passwords are the same now.
You can open the bitnami_credentials file in the home folder of the bitnami user to obtain the password the instance used during the configuration process.
cat /home/bitnami/bitnami_credentials
After that, just run the mysql command to access the database
mysql -u root -p
Current situation is as follows:
I have succesfully installed OpenProject on Ubuntu 14.04 server using the guide from the official website (https://www.openproject.org/open-source/download/packaged-installation-guide/). When configuring for the first time I let the configuration manager install MySQL and create the appropriate database(s).
Now I'm trying to migrate and for this to happen, I need outside access to the information_schema (schema) and database. This is supposedly done using the openproject user but I cannot seem to be able to login using this user on the commandline.
Just to be sure, I just statement below:
mysql -u openproject -D openproject -p
Then I entered the right password and press enter. It gets the default ERROR 1045.
I am however able to login using root user and debian-sys-maint user which was created on the initial install step. The password I used for these accounts were found in the file under "/etc/openproject/installer.dat". I am absolutely positive I use the correct password, for the application runs fine under said user.
Is there a setting in mysql that I am missing that would block users from making connection using the commandline utility?
Figured it out. In MySQL the host 127.0.0.1 and localhost are essentially different. User OpenProject by default gets assigned to host 127.0.0.1, so naturally connecting openproject#localhost did not work, though root account has different user profiles (4 to be exact) allowing it to connect to both localhost and 127.0.0.1 .
TLDR version:
Use the statement as follows:
mysql -u openproject -h 127.0.0.1 -p
Should do the trick.
Everytime I open the command line client, I am asked to log in with the root account by providing the root account password. So my question is, is there a way to log in with another account on the client and how?
Thanks!
Use the -u flag. It should promot you for that users password
mysql -u someotherusername
We are running Jenkins on Cloudbees for building our code base from Github repo for MifosX. For our Integration Test job, we need to create a MySQL DB before each run. We have been able to do that, but would like to change the default MySQL credentials which are "root" and blank password, to some specific "password". Can someone guide us on how to do that?
I assume you are following this guide.
If that's the case, you should be able to follow standard MySQL instructions for setting the root users' password:
mysqladmin -u root password NEWPASSWORD
But I'm not sure why you would want to secure this with a password. Any network ports are isolated from other users, and they certainly don't have access to your files.
I am Mahesh.
I installed jenkins in my linux machine,IT works well as a normal user, When i try to run one script in super user [root] mode,It is not working properly,Even i disable the password in sudoers file it is not working and also It not giving any error It just running the script in normal user instead of root ?? what i do? how i can resolve this problem ??
I just add like this in shell script coloumn in jenkins...
sudo su //comment-->I disable the password so no password required ,I tested in the terminal and am able to enter into root without password with this
sh something.sh
I would advise against running Jenkins (or any application server) as the root user.
Instead of battling the sudo command, why not install the Jenkins ssh plugin and configure the jenkins user to perform an ssh login to the root account?