About admin

My name is Vidyadhar Sarmalkar & I work as a consultant and have done RHCE & CCNA.
Website:
admin has written 272 articles so far, you can find them below.


How to Install MySQL Server Ubuntu

It is an easy task to install MySQL Server on Ubuntu or Debian linux.

This article explains how to install MySQL Server and its Client packages on a Ubuntu / Debian system. At the time of writing this article the latest version of MySQL Server is 5.5.28

We are going to install MySQL using two methods
1. Installing the binary packages using apt-get method
2. Compiling the packages from source

Method 1 Installing from binary packages

Step 1 Open a terminal to run commands

Step 2 Make sure your package management tools are up-to-date. Run following commands to update the package management

sudo apt-get update

Step 3 Run following command to install MySQL server and client packages

sudo apt-get -y install mysql-server mysql-client

When done, you have a MySQL database ready.

You need to set a root password. MySQL has it’s own user accounts, which are not related to the user accounts on your Linux machine. By default, the root account of the MySQL Server is empty. You need to set it. Please replace ‘mypassword’ with your actual password and myhostname with your actual hostname.

sudo mysqladmin -u root -h localhost password 'mypassword'
sudo mysqladmin -u root -h myhostname password 'mypassword'

Method 2 Installing from source packages

Step 1 Open a terminal to run commands

Step 2 Make sure your package management tools are up-to-date. Run following commands to update the package management and install the tools need to build MySQL from source

sudo apt-get -y install build-essential cmake g++ libncurses5-dev bison libaio-dev

Step 3 Downloading and Extracting the package
We will be downloading the package to /usr/local folder

cd /usr/local
sudo wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.28-linux2.6-i686.tar.gz
sudo tar zxvf mysql-5.5.28-linux2.6-i686.tar.gz
sudo ln -s mysql-5.5.28-linux2.6-i686 mysql

Step 4 Creating a user and group requires for MySQL

sudo groupadd mysql
sudo useradd -g mysql mysql

Step 5 Assigning proper permission to MySQL server directory

cd /usr/local/mysql
sudo chown -R mysql .
sudo chgrp -R mysql .

Step 6 Installing a sample database and starting a server

cd /usr/local/mysql
sudo scripts/mysql_install_db --user=mysql
sudo chown -R root .
sudo chown -R mysql data
sudo bin/mysqld_safe --user=mysql &

If everything goes well, you should have a MySQL instance running now. To check the same run following command

ps auxwww | grep mysql

Output would be

root@vidyadhar:/usr/local/mysql# ps auxwww | grep mysql
root     13946  0.2  0.0   2216   612 pts/0    S    17:19   0:00 /bin/sh bin/mysqld_safe --user=mysql
mysql    14010  3.1  2.3 293484 35096 pts/0    Sl   17:19   0:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/vidyadhar.err --pid-file=/usr/local/mysql/data/vidyadhar.pid

When done, you have a MySQL database ready.

Step 7 You need to set a root password. MySQL has it’s own user accounts, which are not related to the user accounts on your Linux machine. By default, the root account of the MySQL Server is empty. You need to set it. Please replace ‘mypassword’ with your actual password and myhostname with your actual hostname.

sudo /usr/local/mysql/mysqladmin -u root -h localhost password 'mypassword'
sudo /usr/local/mysql/mysqladmin -u root -h myhostname password 'mypassword'

Step 8 If you want MySQL to start automatically with every system restart, add the following lines to /etc/rc.local

/usr/local/mysql/support-files/mysql.server start

For basic commands refter this article MySQL Basic

Install the Cinnamon Desktop on Ubuntu

I was using unity for quite couple of months, but problem is I still don’t prefer it as my desktop environment at work place. If given an option between unity and gnome classic, I will definately choose gnome classic.

Recently I come to know about Cinnamon desktop. Cinnamon desktop is a project of Linux Mint, a desktop distribution based on Ubuntu Desktop itself. Cinnamon is a Gnome-Shell desktop fork. It is not strictly a Gnome-2 interface, although the developers aims are laudable to produce a simpler more traditional desktop interface.

Development seems to be rapid. It is usable and certainly fun to play with with a growing number of extensions to install to extend the base installation.

This article show the simple steps needed to install and use Cinnamon on Ubuntu 12.04

Step 1 Open a terminal and run following commands. Basically you are going to add repository to install Cinnamon desktop

sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get install cinnamon

Step 2 Logout and select the Cinnamon session:
Install the Cinnamon Desktop on Ubuntu 1

Step 3 Enter you password and you’ll see the Cinnamon desktop
Install the Cinnamon Desktop on Ubuntu 2

showing the traditional start type menu and applet design from Gnome-2
Install the Cinnamon Desktop on Ubuntu 3

Extensions/Applets

The Cinnamon desktop uses the same philosophy as Gnome-Shell – functionality can be added to by installing Extensions & Applets.

Cinnamon uses its own Settings tool.

Cinnamon Settings
Install the Cinnamon Desktop extension applets on Ubuntu 1

Cinnamon Applets
Similar to gnome-shell extensions – you can install applets from a dedicated Mint website.
Install the Cinnamon Desktop extension applets on Ubuntu 2

Reset the Websphere Application Server Administrative Console Password

In our production enviournment we always enable security to protect our server from unauthorized users.

As a recent case, one of our administrator has forgot the password after re-setting it. We took following steps to disable the security for time-being so that we can reset the password.

WARNING: Please use this as the last resort and make sure the server is not in the middle of processing any transactions.

There are 2 possible methods for disabling security

Method 1 By way of wsadmin command
Note : WAS_HOME would be Websphere Application Server path where you have actully installed Websphere Application Server. In my case path is D:\IBM\WebSphere\AppServer

Step 1 Open a command prompt and type following commands

cd <WAS_HOME>\bin\
wsadmin -conntype NONE

Disable_Webspher_application-server-global-security-1
Disable_Webspher_application-server-global-security-2

Step 2 Run securityoff command in wsadmin console to disable the Global Security

wsadmin>securityoff

Disable_Webspher_application-server-global-security-3
Disable_Webspher_application-server-global-security-4

Step 3 Run exit command in wsadmin console to exit from the wsadmin command window

wsadmin>exit

Disable_Webspher_application-server-global-security-5

Step 4 That’s it. Now restart the servers.

Step 5 Enable the security from administrative console.

Step 6 Restart the servers.

Method 2 : By way of manual edit of security.xml file

Step 1 Create a copy of security.xml file from \profiles\DMGR_PROFILE\config\cells\CELL_NAME\ in case you need to roll back.

Step 2 Disable the security from the security.xml file (change the very first occurrence of enabled=”true” to enabled=”false”)
Disable_Webspher_application-server-global-security

Step 3 Restart the servers.

Step 4 Enable the security from administrative console.

Step 5 Restart the servers.

How to Disable the Recovery Mode Ubuntu

Today I have given the responsibility to setup Ubuntu machine for school group. Nowadays kids are very smart and they can do the system level changes easily if they know the root password or they can start the machine as a dingle user. I though to disable single user mode / recovery mode booting to make it little bit more secure

To achieve the same I have followed following step which help me to remove single user / recovery mode from GRUB permanently.

Step 1 Open a terminal with Ctrl+Alt+T shortcut and type this command and then hit Enter

gksu gedit /etc/default/grub

Step 2 The above command will open grub default file in gedit text browser. Search for a section like this one

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

Remove the # mark from the line #GRUB_DISABLE_RECOVERY=”true”. The changed section should look like this

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

Save the file by pressing Ctrl+S then exit Gedit.

Step 3 Then again going to the terminal, execute the below command:

sudo update-grub

Step 4 Restart to see that the recovery option has gone.

How to Password Protect Grub2 Boot Loader Ubuntu

The grub2 password protection procedure can be quite tricky and if you get it wrong there is a possibility of leaving yourself with a non-bootable system. Thus always make a full image backup of your hard-drive first. My recommendation would be to use Clonezilla or PartImage.

If you want to practice this use a virtual machine guest which you can rollback a snapshot.

The procedure below protects unauthorised editing of Grub settings whilst booting i.e, pressing “e” to edit allows you to change the boot options. You could for example, force booting to single user mode and thus have access to your hard-disk.

This procedure should be used in conjunction with hard-disk encryption and a secure bios boot option to prevent booting from live cd.

Almost everything below can be copied and pasted one line at a time.

First lets backup the grub files we will be editing. Open a terminal session and type following:

sudo mkdir /etc/grub.d_backup
sudo cp /etc/grub.d/* /etc/grub.d_backup

Lets create a username for grub:

gksudo gedit /etc/grub.d/00_header &

Scroll to the bottom, add a new empty line and copy and paste the following:

cat << EOF
set superusers="myusername"
password myusername xxxx
password recovery 1234
EOF

In this example two usernames were created: myusername and recovery

Next navigate back to the terminal (don’t close gedit):

For Natty and Oneiric users only

Generate an encrypted password by typing

grub-mkpasswd-pbkdf2

Enter your password you will use twice when prompted

Your PBKDF2 is grub.pbkdf2.sha512.10000.D42BA2DB6CF3418C413373CD2D6B9A91AE4C0EB4E6AA20F89DFA027CA6E6CBF3542CB39E951607E9D651D82700AF47884929BDD193E36CB262CC96201B5789AA.1A9B0033928E3D3D0338583A5BF13AF7D5CC6EC5A41456F8FE8D8EBEB7A093CD0A0CE8688949E6007188ECB3FB0FF916F258602D130CF5C8525FB318FBBE2646

The bit we are interested in starts grub.pbkdf2… and ends BBE2646

Highlight this section using your mouse, right click and copy this.

Switch back to your gedit application, highlight the text “xxxx” and replace this with what you copied (right click and paste)

i.e. the line should look like

password myusername grub.pbkdf2.sha512.10000.D42BA2DB6CF3418C413373CD2D6B9A91AE4C0EB4E6AA20F89DFA027CA6E6CBF3542CB39E951607E9D651D82700AF47884929BDD193E36CB262CC96201B5789AA.1A9B0033928E3D3D0338583A5BF13AF7D5CC6EC5A41456F8FE8D8EBEB7A093CD0A0CE8688949E6007188ECB3FB0FF916F258602D130CF5C8525FB318FBBE2646

All Ubuntu versions (lucid and above)

Save and close the file.

Finally you need to password protect each grub menu entry (all files that have a line that begins menuentry):

cd /etc/grub.d
sudo sed -i -e '/^menuentry /s/ {/ --users myusername {/' *

This will add a new entry i.e users myusername to each line.

Run update-grub to regenerate your grub

sudo update-grub

When you try to edit a grub entry it will ask for your user name i.e. myusername and the password you used.

Reboot and test that username and password is being enforced when editing all of the grub-entries.

Kindly note that remember to press SHIFT during boot to display your grub.

Page 6 of 55« First...«456789»102030...Last »
rss twitter facbook

Categories

Archives