About admin

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


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.

Adding Icons in Notification Area Ubuntu

Recently while doing some testing, I accidentally removed an icon from the Notification area.

I have followed the following steps to add the icons in the the Notification area

Step 1 Right Click on the panel, Go to Panel > Add new Items

Step 2 In the Add New Items window, Click Launcher and Click Add button. A launcher icon will be added to the panel.

Step 3 Right Click on the new Launcher, Select Properties from the popup menu.

Step 4 In the Launcher window, In the General tab, Click on the + button.

Step 5 In the newly appeared Add new Item window, in the search box, type the program name, in my case I want to add pidgin, so I typed “pidgin”, Select the Pidgin icon and Click Add button. The launcher will be converted to pidgin icon.

Step 5 Now, Right click on the newly added icon and select move to move it to the desired position in the panel.

Install the Oracle Java JDK 7 on Ubuntu

Step 1 To start with first we have to download the compressed binary file for your architecture. I am using 32bit OS so i will be downloading 32bit package of JDK. You can download the packages from here.

Step 2 Now uncompress it

tar -xvf jdk-7u2-linux-i586.tar.gz

Step 3 JDK 7 package is extracted into ./jdk1.7.0_02 directory. Now move the JDK 7 directory to /usr/lib

sudo mv ./jdk1.7.0_02 /usr/lib/jvm/jdk1.7.0

Step 4 Now run

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1

Step 5 Now run following command to change java path

sudo update-alternatives --config java

You will see output similar one below. Choose the number of jdk1.7.0. For example 3 in this list:

$sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
 
Selection Path Priority Status
————————————————————
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
3 /usr/lib/jvm/jdk1.7.0/jre/bin/java 3 manual mode
 
Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/jdk1.7.0/jre/bin/java to provide /usr/bin/java (java) in manual mode.

Step 6 Check the version of you new JDK 7 installation:

java -version
java version “1.7.0”
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode)

Step 7 Repeat the above for:

sudo update-alternatives --config javac
sudo update-alternatives --config javaws

Step 8 Enable mozilla firefox plugin:
32 bit:

ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/

64 bit:

ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
Page 6 of 54« First...«456789»102030...Last »
rss twitter facbook

Categories

Archives