how to run jenkins as super user? - hudson

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?

Related

How to reset root password of a Google Compute Engine VM?

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.

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.

AWS Lightsail Bitnami LAMP - Installing 2nd Wordpress Module not working

I have a LAMP stack on my AWS Lightsail server with one wordpress application currently. I am trying to load another wordpress intall, wordpresskva, on my server (not using multisite for personal reasons). So I ran the bitnami installer with --wordpress_instance_name wordpresskva. But it fails when I get to:
Create Admin account
Please enter the MySQL password for "root" for the existing Bitnami installation
Password :
I put in the application password (bitnami_application_password in the ~ directory) but it then says:
Warning: The installer was not able to connect to the MySQL server. Please make
sure MySQL is running and introduce a valid password to connect to the MySQL
server.
Press [Enter] to continue:
This is strange, since when I enter the same password here:
$ mysql -u root -p
Enter password:
It lets me get into the mysql server. I checked the status of the server and everything seems fine, so I am really confused as to what is wrong with the password/setup I am using.
Could you please help me troubleshoot this problem?
I guess you're following the guide below:
https://docs.bitnami.com/installer/apps/wordpress/#how-to-install-several-wordpress-modules-on-the-same-stack
And I also guess you're using the WordPress module installer below:
https://downloads.bitnami.com/files/stacks/wordpress/4.9.4-2/bitnami-wordpress-4.9.4-2-module-linux-x64-installer.run
I just launched a new LAMP Server on Lightsail and run the commands:
wget https://downloads.bitnami.com/files/stacks/wordpress/4.9.4-2/bitnami-wordpress-4.9.4-2-module-linux-x64-installer.run
chmod +X bitnami-wordpress-4.9.4-2-module-linux-x64-installer.run
sudo ./bitnami-wordpress-4.9.4-2-module-linux-x64-installer.run
And I chose /opt/bitnami as installation directory:
Please choose a folder that contains an installation of Bitnami.
Select a folder []: /opt/bitnami/
Then I use the use the password obtained from bitnami_application_password when prompted for the MySQL password:
Please enter the MySQL password for "root" for the existing Bitnami installation
Password :
----------------------------------------------------------------------------
WordPress
Please configure WordPress installation
As you can check everything worked as expected. Please repeat the process and ensure you type the password correctly (with no spaces), it should work.

mysql cant log in as a regular user using root, same as phpmyadmin

I installedd LLMP on default, fresh Linux Mint 18 Mate install. Everything is updated and pretty fresh. Then the strange problem occured with logging into the database.
My exact steps:
1. Installed lighttpd. It crashed until I installed also gamin package, then it works.
Installed php7 with php-mysql
Installed mariadb-server
Run mysql_secure_install, defined new root password, answered all Y for deleting test db, disabling anonymous accounts and disallowing root login from tcp, etc. Everything was suggested as a valid, default answer.
Installed phpmyadmin, this fails on post-install, but running apt-get install -f repaired it and finished install correctly.
WTF1: Now, as root user I can login without password to mysql in the console.
WTF2: I can't login to mysql as a regular user, even when I give good password. It says "ERROR 1698 (28000): Access denied for user 'root'#'localhost'"
WTF3: I can't also login to database using phpmyadmin, using root account and proper password, when run on my localhost workstation via lighttpd.
What the heck is going on? My expectation was it should work out of the box, allowing me to login ONLY with root password either on CLI or via phpmyadmin. What is wrong?
I solved this and the answer is in the comment to the question.

phpMyAdmin Log In with openshift

Since today, I can't log in to phpMyAdmin while until now it was working fine. I'm using root user and root password given when I installed phpMyAdmin. I tried to desinstall and install it again but it didn't change the problem. I have the same problem on another server openShift. Can you help me please? Many thanks.
Log in failed
You can not login to phpMyAdmin on OpenShift Online as the root user. If you have lost your username/password for MySQL you can find them again by using one of the following options:
SSH into your application using the "rhc ssh" command, and then run the command "env | grep MYSQL". This will then show your correct mysql username/password
Log into the OpenShift Online web console, view the details for the application and you can view the user/password for the MySQL cartridge
Use the "rhc app show" command, which will show you the username/password for your MySQL cartridge in it's output.