Sunday, April 1, 2012

reset weblogic password

Steps to create another superuser in weblogic (when password of existing user is lost)

1. Shutdown WebLogic Server (If Running) – Optional Step

2. Login to WebLogic Server and set environment variable

cd $DOMAIN_HOME/bin   (where DOMAIN_HOME is directory in which your domain exists, default value is $MW_HOME/user_projects/domain/base_domain)

. ./setDomainEnv.sh

3. Create a initialization file using command

java weblogic.security.utils.AdminAccount   .  (Note the DOT at end of this command)

For Example

java weblogic.security.utils.AdminAccount weblogic welcome1 . (Note the DOT at end of this command)

This will create file  DefaultAuthenticatorInit.ldift in directory from which you executed this command .

4. Move file DefaultAuthenticatormyrealmInit.ldift  from $DOMAIN_HOME/security/ and replace it by  DefaultAuthenticatorInit.ldift generated in step 3

5. Move data directory under $DOMAIN_HOME/servers//datato another directory like data.bak (data directory contains files related to embedded LDAP and role mapping file). Replace with WebLogic Server like AdminServer and managed server. Repeat this step for all managed servers which are part of this domain.

This step will remove all existing users/groups from WebLogic’s embedded LDAP server (recreate these users/groups in setp8)

6.Recreate boot.properites (if any) under $DOMAIN_HOME/servers//security with username and password created in step 3 above like
USERNAME=weblogic
PASSWORD=welcome1

7.Start (or restart) Admin Server and test if you can login to weblogic console using new username and password. 

8. Recreate any users/groups(which were part of default authenticator prior to new super user creation) or import existing users (from weblogic’s servers embedded LDAP server backup)

Wednesday, March 21, 2012

Setting Internet Sharing

set ip PC gateway
# ifconfig eth0 192.168.0.6 netmask 255.255.255.0

set default gateway in PC gateway(internet sharing)
# route add default gw 192.168.0.5

- enable IP forwarding
# echo 1 > /proc/sys/net/ipv4/ip_forward

or



# sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1

- set firewall

# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE

or use SNAT

# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT 192.168.0.6

- show rule

iptables -t nat -nL

- to make permanent set in /etc/rc.local

nb : 192.168.0.5 --> IP DSL Modem / router
192.168.0.6 --> IP PC gateway(Internet Sharing)

Monday, March 12, 2012

Reinstall GRUB in RHEL Linux

# grub
grub> root (hd0,0)
root (hd0,0)
Filesystem type is ext2fs, partition type 0xfd
grub> setup (hd0)
setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
grub> quit
# reboot

Tuesday, February 21, 2012

Add samba user

At this point you should be able to see the samba server from any windows system in the same workgroup but you won't be able to access the share; not until you add the user(s).

Samba authenticates its users through its local database. Once you have saved the changes to smb.conf , you need to add the users.

Since you enabled the encrypted password option in your smb.conf, you need to add the users with encrypted password.

Add your existing users to samba or create new users and then add them to samba.



[root@server2 samba]# smbpasswd –a agustin
New SMB password: ********
Retype new SMB password:********

Enter the password in 8 character length or more, if you enabled the user name length specification, then it must meet the requirement. Note that agustin is an existing user in the system.

Note. If the command fails it is because the password file does not exist. Retouch the file with the following command and try again.

[root@server2 samba]# touch /etc/samba/smbpasswd

Finally change the smbpasswd security to 644

[root@server2 samba]# chmod 644 smbpasswd

That command will make it read only!