google compute engine VM instance : my root password? - google-compute-engine

I'm using google cloud platform compute engine.
I created a VM instance (OS : Ubuntu 16.04)
I want to change some system config. However system requires me to enter password.
I haven't got password. I don't know my password.
What is my password?

By default there is no root password on GCE instances. You have several options:
As all users are added to sudoers, you can run the command as root with: sudo invoke-rc.d procps start
You can log in as root with sudo -i
You can set a root password by running sudo passwd

GCE don't set any clear-text password for any user, it only sets ssh keys
You can ssh into instance directly from web console
You can use all root privileges by using sudo [COMMAND --ARG1..]
To set root password ssh into instance
Type : sudo passwd root (for linux machines)
It will ask for new password but whatever password you are typing won't show, It's hidden, just press enter after done typing
Also if you are trying to ssh into instance as root, you will need to edit /etc/ssh/sshd.config and change Permit root login and Password Authentication to yes
Hope it helps

By default, there's no root password on your VM instance. If you want, you can set it manually.
sudo -i
sudo passwd

Related

Mysql root auth_socket to empty password

By default, root user in a freshly installed mysql-server is set to auth_socket which allows you to login via sudo mysql.
But in most cases, especially in your local machine, your application will connect to your database using a root credential with no or empty string password.
I followed this post step-by-step, however, I ended up having a non-empty password for my root user.
Here's what I did:
sudo mysql
UNINSTALL COMPONENT 'file://component_validate_password'; in case you run sudo mysql_secure_installation during the installation. This will allow you to set an empty string to any user's password.
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY '';
exit mysql and restart the service --> sudo service mysql restart
You should be able to login using your root by mysql -u root -p and just hit ENTER if after being asked for the password.

Unable to login in my gcloud compute engine xrdp using Remote Desktop

Hello i have installed xrdp and xfce4 on my gcloud compute engine. below is the process for installation:
i had a user with name myadav on the ubuntu 16.04 server:
so i first install xrdp by :
sudo apt-get install xrdp
and then i installed :
sudo apt-get install xfce4
then i perform some command for initiating xrdp and xfce4:
echo xfce4-session >~/.xsession
sudo vim /etc/xrdp/startwm.sh
Add the following lines at the end of the file:
. /etc/X11/Xsession
. /usr/bin/startxfce4
sudo service xrdp restart
Now when i use windows RDP and type my external ip i get a xrdp login screen. My problem is that, when i type username as myadav which is a ubuntu user, unable to login. What is the username and password for login into my system. Thanks for your time.
Make sure that the user account that is to be used for logging in is a member of the tsusers group (this is a group that should be created by the XRDP program).
sudo usermod –a –G tsusers ‘username’
You can also try to troubleshoot the problem by editing the xrdp.ini configuration file.There are options for passwords where you can set a password:
password=<password>|ask
Specifies the password used for authenticating in the connection. If set to ask, password should be provided in the login window.
If anyone is here looking out for others answers than the above accepted answer, you could try below which in fact worked for me.
if you have not setup a password for root user please do so using sudo passwd.
use username as `root and your setup password for login to the system.

Raspberry-Pi 3: LAMP Web Server with WordPress

I want to build a LAMP Web Server with WordPress using a Raspberry-Pi 3 and I have followed this tutorial:
https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress
I am having some problems with MySQL installation, because using the command
$ sudo apt-get install mysql-server php-mysql -y
I can't select the root password, as written in the tutorial. Then, I am not able to enter the MySQL database with command
$ mysql -uroot -ppassword
neither using
$ mysql -uroot -p
The only way to enter the database is to use (without any password)
$ sudo mysql -uroot
In the last step of tutorial, when I have to select the database connection details, I don't know which password to use.
Can anyone help me?
Thank you!
There are two "roots".
The password for the OS's root is used for sudo.
The password for MySQL's root is used for mysql -u root -p.
There should be no need for sudo mysql .... But when you do it, first the OS has control and either remembers that you are sudo, or prompts something like
[sudo] password for root:
Then mysql gets control and sees the -p, so prompts you:
Enter password:
During the setup, were you ever asked to create a mysql root password? If not, then mysql -uroot would get into mysql without a password. You should create a password then for security.
This is possibly caused by the change that Debian did to MariaDB. They enabled the UNIX socket authentication plugin by default for newer versions. This would explain why no password is required.
If you want to enable password authentication, you could create a separate root user account. This appears to be required to complete the tutorial.
CREATE USER 'root'#'127.0.0.1' IDENTIFIED BY 'my-password';
This creates the user root with the password my-password which you can then add to the WordPress configuration.

Problems installing openEMM on Centos 6 running Plesk 11

I am trying to install openEMM on a Centos 6 VDS and have run into a snag. I am following the instructions on this page: http://www.roothelp.net/install-openemm-on-centos-6-x/. Everything has gone along fine until I reached the following commands:
service mysqld start
/usr/bin/mysql_secure_installation
cd /usr/share/doc/OpenEMM-2013/
mysqladmin -u root -p create openemm
The service starts fine, but when I run /usr/bin/mysql_secure_installation I get the following:
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and you
haven't set the root password yet, the password will be blank, so you
should just press enter here.
Enter current password for root (enter for none):
This is where the problems start. Apparently Plesk 11 does not create a root user account, using "admin" instead. None of my passwords work here, neither my actual SSH root password, my admin password, or any other password I've assigned. I even started mysql with this script to ensure I had the correct root password:
>UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
>FLUSH PRIVILEGES;
I tried this to ensure I had the correct password: /usr/local/psa/bin/admin --show-password
None of this has worked, and I am unable to run the command. How can I get around this? If I skip that command (GoDaddy support advised me that it was only configuring MySql, which is already installed with Plesk) and try to run
mysqladmin -u root -p create openemm
I am again asked for a root password and none work. I also tried this command instead, using the admin password but still had the same problem.
mysqladmin -u admin -p create openemm
I suspect I'll have to create a database called openemm through Plesk. Any ideas?
If you haven't set the mysql root password you can set it through the command
`$> mysqladmin -u root password "yourpassword"`
and if you want to change (or update) a root password, then you need to use the following command:
$> mysqladmin -u root -p'oldpassword' password newpass
Then you can create your database. In your case I think the mysql root password is just entered as the secure script asked you.

mysql password works in Terminal, but not in phpMyAdmin?

I can log in to mysql through Terminal using
mysql -u root -p
I'm prompted with:
Enter password:
When I enter the password I get:
Welcome to the MySQL monitor....
However, when I try to user the same username/password combination into phpMyAdmin I get the rror:
#2002 Cannot log in to the MySQL server
Note: I am using Snow Leopard
I think that either the root is disabled by default on remote host (considering that your mysql server and your http server are on different host), or the remote root password is different from the one on localhost (same reason).
It would be a way better to create a new admin user rather than using root remotely (the new username is obviously less easy to guess).
Because I am in Snow Leopard, I had to do the following.
Open Terminal
cd /etc/
sudo nano php.ini // or php.ini.default
Password: (enter my password)
And replace var/mysql/mysql.sock with the following:
pdo_mysql.default_socket=/tmp/mysql.sock
mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock
Then in Terminal
sudo apachectl restart
It might happen when, there is no controluser configured for phpMyAdmin in your database.
By default it is like below from config file.
$cfg['Servers'][$i]['controluser'] = 'pma';
You can also check existing database users by following query:
select * from mysql.user;
Wish it will help.