Showing posts with label Solaris. Show all posts
Showing posts with label Solaris. Show all posts

Tuesday, January 15, 2013

Adding Memory to a Solaris Zone on the fly

Well good morning and god bless everyone. This is a quick tutorial on how to Add memory to a Solaris Zone on the fly while its running without a reboot, Solaris Zones is some pretty cool technology well enough chatter from me lets get to it.

prctl, rcapadm can modify a running zone. and the zonecfg defines the resource parameters of the zone when it boots.

So in order to make changes dynamically you will have to do the following:
1. Update the zonecfg.
2. Use the prctl, rcapadm commands to modify the zone while it is online. make sure that everything matches the changes you've made to the zonecfg.

Below are the detail steps to add the capped-memory  to the running zone container.

zonecfg -z blah 

zonecfg:blah; select capped-memory
zonecfg:blah:capped-memory> info 
capped-memory:
physical: 1G
[swap: 2G]
[locked: 512M]
zonecfg:blah:capped-memory> set physical=2g
zonecfg:blah:capped-memory> set swap=3g

zonecfg:blah:capped-memory> info 
capped-memory:
physical: 2G
[swap: 3G]
[locked: 512M]
zonecfg:blah:capped-memory> end
zonecfg:blah> exit


Modify the zones running settings:

blah:/
# rcapadm -z blah -m 2048m

blah:/
# sleep 60

blah:/
# rcapstat -z 1 1 

blah:/
prctl -n zone.max-swap -v 3g -t privileged -r -e deny -i zone blah

Verify that the settings have taken effect

zlogin -C blah 

Then run the top command 

#top -c 

Well its about that time, i hope you enjoyed and really got something out of this tutorial. 
 until next time i wish you nothing but happiness and success. 

Sunday, January 13, 2013

Understanding ZFS (Zpools)

Good Morning everyone hope everyone is enjoying the weekend, This is a quick tutorial on the zfs filesystem mainly focusing on zpools. But before jumping into command and how things work let me give you a little background on the zfs filesystem, ZFS which stands for Zetabyte File System is a 128bit filesystem that is also a volume manager rolled up in on. In reality this is the Sun Volume manager on steroids. With the Sun Volume Manager the admin had to use soft partitioning in order to expand disk space on the ufs filesystem, this is not so with the zfs filesystem. By simply adding a disk to the disk pool automatically adds disk space to the volume this is such a cool filesystem. Over time developers have ported zfs over to linux and freebsd which in my most humble opinion is the best OS(bsd) :). Well enough of this chatter let me show some of the cools stuff that zfs has to offer beginning with zpools. Zpools are the heart of the zfs filesystem , without zpools there is no zfs period, in order to use zfs you  will have to create a zpool by typing in the following command.

# zpool create (which in my case is nixpool :) )  

#zpool create nixpool c1t0d0s0


List all zpools 

# zpool status -xv 
all pools are healthy

Creating a mirrored zpool 

#zpool create nixpool mirror c0d0 c1d0

Creating a mirrored zpool with a hot spare#Note: These devices are not actively used in the pool, but when an active device fails, it is automatically replaced by a hot spare zfs rocks :).

#zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0

Create a zpool with log devices. log devices come in handy sometimes for example databases often require their transactions to be a on a stable storage devices when returning from a system call. Multiple log devices can also be specified and they can be mirrored. 


# zpool create nixpool c0d0 c1d0 log c2d0 

Another cool thing about zpools is that their properties can be modified. you can get a list of zpool properties by running their following command:

# zpool get all testpool

Adding a Mirror to a Zfs Storage Pool Note: The following command addss two mirrored disks  to the 
pool nixpool, assuming the pool is already made up of two-way mirrors.

# zpool add nixpool mirror c1t0d0 c1t1d0


Destroying a zpool Note: the following command destroys the pool nixpool and any datasets contained within. 


# zpool destroy -f nixpool 

well this will conclude  the zpool tutorial, if you desire to know more about the zpool command. Please go through and read the man pages on your local unix system  

man zpool :).




Saturday, December 18, 2010

Solaris still rocks

I'm going to be truthful i was kinda worried about the future of Solaris when Oracle bought the company. now after reading through the results of the fiscal year 2011. Think that solaris still has a fighting chance. I love it IBM and HP can kick rocks lol :). After reading the following url:

http://www.theregister.co.uk/2010/12/17/oracle_q2_f2011_numbers/

Oracle Corporation (NASDAQ: ORCL) today announced both fiscal 2011 Q2 GAAP and non-GAAP total revenues were up 47% to $8.6 billion. Both GAAP and non-GAAP new software license revenues were up 21% to $2.0 billion. GAAP software license updates and product support revenues were up 12% to $3.6 billion, while non-GAAP software license updates and product support revenues were up 12% to $3.7 billion. Both GAAP and non-GAAP hardware systems products revenues were $1.1 billion. GAAP operating income was up 27% to $2.8 billion, and GAAP operating margin was 32%. Non- GAAP operating income was up 33% to $3.8 billion, and non-GAAP operating margin was 44%. GAAP net income was up 28% to $1.9 billion, while non-GAAP net income was up 34% to $2.6 billion. GAAP earnings per share were $0.37, up 27% compared to last year while non-GAAP earnings per share were up 33% to $0.51. GAAP operating cash flow on a trailing twelve-month basis was $9.1 billion.

How to Fix No hostname when using DHCP in Solaris

Good Morning all, sorry for the late blog you guys just been busy with life and other projects but since things are slowing down for me i just want to write a quick tutorial on how to make sure that your solaris box uses the hostname that you pick when running solaris as a dhcp client.

#######################
#Disclaimer #
#######################

This configuration was what i used to make dhcp client hostname work for me im not saying that this will definitly work for you b/c i dont know you setup so use this tutorial at your own risk :)


Ok with that out of the way lets begin.


If you are using DHCP to receive IP Address for your Sun Solaris system, you may end up with no hostname assigned to the system. This can be confirmed when there is no hostname at the prompt or if the output for the command “hostname” is as follows:

# hostname
unknown

or the /etc/hosts file has an entry as follows:

# cat /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
192.168.0.3 unknown # Added by DHCP


This happens when the DHCP server doesn’t provide a hostname for your server. Most of the DHCP Servers or routers acting as a DHCP Server doesn’t provide a hostname and Solaris DHCP agent relies on the DHCP server for its hostname.To fix this problem, edit the dhcpagent config and set it not to request a Hostname from the DHCP server and then add a hostname to the /etc/hosts & /etc/nodename file.



Edit DHCPAGENT config

[For Solaris 10, this is not required as setting the hostname in /etc/nodename overrides the hostname provided by the DHCP Server. Move onto the next step]

Edit the dhcpagent config file /etc/default/dhcpagent with your favorite editor

# vi /etc/default/dhcpagent

and look for

PARAM_REQUEST_LIST=1,3,6,12,15,28,43

and remove the Parameter “12″ from the above to look as follows:

PARAM_REQUEST_LIST=1,3,6,15,28,43

and save the file.

Now, add the hostname to the /etc/nodename & /etc/hosts as follows

# vi /etc/nodename

and add the hostname you want it to have (solarisserver for me)

# cat /etc/nodename
solarisserver

and edit the /etc/hosts file

# vi /etc/hosts

and add the line similar to the following

192.168.0.3 solarisserver loghost

Now,reboot the server and you should be all fine with hostname set for the system.

# init 6

Wednesday, November 24, 2010

Oracle cashes in with 1.3 billion

I Thought that this would be something of interest for all oracle lovers out there :). SAP AG must pay $1.3 billion to rival Oracle Corp. for copyright infringement, a federal jury ruled Tuesday, following a high-profile court battle between the business-software makers. All i can say is Merry Xmas early for Oracle :) Larry is smiling from ear to ear hell i would be too with all that money.

Monday, June 7, 2010

How to Setup PostgreSQL database on Solaris 10

By default PostgreSQL comes with solaris 10. To check if PostgreSQL is installed in your Solaris instance you can use the following command:

$ svcs "*postgres*"
STATE STIME FMRI
disabled Feb_16 svc:/application/database/postgresql:version_81
disabled 16:11:25 svc:/application/database/postgresql:version_82

If you don't see any PosgreSQL instance in your Solaris box then proceed and install the following packages (the list may actually change over time):
* SUNWpostgr
* SUNWpostgr-contrib
* SUNWpostgr-devel
* SUNWpostgr-docs
* SUNWpostgr-jdbc
* SUNWpostgr-libs
* SUNWpostgr-pl
* SUNWpostgr-server
* SUNWpostgr-server-data
* SUNWpostgr-tcl


After installation, SMF services should be listed by (the output may depend on the actual PostgreSQL version you installed):

$ svcs "*postgres*"
STATE STIME FMRI
disabled Feb_16 svc:/application/database/postgresql:version_81
disabled 16:11:25 svc:/application/database/postgresql:version_82




PostgreSQL on Solaris uses RBAC to give users permissions over the database instance. When you install Solaris' PostgreSQL packages an RBAC role is setup for you:


[/etc/passwd]
postgres:x:90:90:PostgreSQL Reserved UID:/:/usr/bin/pfksh

This user is setup as an RBAC role in /etc/user_attr file:

[/etc/user_attr]
postgres::::type=role;profiles=Postgres Administration,All

Permission for the Postgres Administration profiles are setup in the /etc/security/exec_attr file:

[/etc/security/exec_attr]
Postgres Administration:solaris:cmd:::/usr/postgres/8.2/bin/initdb:uid=postgres
Postgres Administration:solaris:cmd:::/usr/postgres/8.2/bin/ipcclean:uid=postgres
Postgres Administration:solaris:cmd:::/usr/postgres/8.2/bin/pg_controldata:uid=postgres
Postgres Administration:solaris:cmd:::/usr/postgres/8.2/bin/pg_ctl:uid=postgres
Postgres Administration:solaris:cmd:::/usr/postgres/8.2/bin/pg_resetxlog:uid=postgres
Postgres Administration:solaris:cmd:::/usr/postgres/8.2/bin/postgres:uid=postgres
Postgres Administration:solaris:cmd:::/usr/postgres/8.2/bin/postmaster:uid=postgres

Starting PostgreSQL
You can start PostgreSQL using the following SMF command from an account with the appropriate privileges:

$ su - postgres
$ svcadm enable svc:/application/database/postgresql:version_82

Initial Configuration
By default, PostgreSQL is configured to trust all of the local users. That's not a good practice because all your local users may connect to PostgreSQL as a superuser. The first to do is setting up a password for the postgres user:

$ psql -U postgres
postgres=# alter user postgres with password 'your-password';

Exit psql with the \q command and change the /var/postgres/8.2/data/pg_hba.conf file to set an appropriate authentication method and change the following line:

[/var/postgres/8.2/data/pg_hba.conf]
local all all trust

with, for example:

[/var/postgres/8.2/data/pg_hba.conf]
local all all md5

Next time you connect, PostgreSQL will be asking you for the user password. Now, let's refresh the PostgreSQL service so that PostgreSQL will receive a SIGHUP signal an re-read the pg_hba.conf file:

$ svcadm refresh svc:/application/database/postgresql:version_82

Done!
You're now running a PostgreSQL instance on your Solaris box ready to be given to your database administrator, ready for production use.

How to Add/Remove network interfaces to a running zone container

Well good morning everyone. This is a quick tutorial on how to add a network interface to a running zone container in solaris 10, without have to go through the trouble of rebooting the zone. Also not e that this configuration change will persist between reboots. With that being said lets get to it.


First you add the entry to the zone configuration. This is the part that lets it persist between reboots. This is done from the global zone:

# zonecfg -z zone1
zonecfg:slabzone1> add net
zonecfg:slabzone1:net> set address=XXX.XXX.XX.XXX
zonecfg:slabzone1:net> set physical=e1000g0
zonecfg:slabzone1:net> end
zonecfg:slabzone1> verify
zonecfg:slabzone1> commit
zonecfg:slabzone1> exitNow we have to manually add a new interface to the running zone. Do this from the global zone as well

# ifconfig e1000g0 addif XXX.XXX.XX.XXX netmask XXX.XXX.X.X zone zone1 up

Created new logical interface e1000g0:3

Note: The ‘addif’ tells ifconfig to create a logical interface using the next available.

# ifconfig -a
lo0:1: flags=2001000849 mtu 8232 index 1 inet 127.0.0.1 netmask ff000000
e1000g0:1: flags=1000843 mtu 1500 index 2 inet XXX.XXX.XX.XXX netmask ffffff00 broadcast XXX.XXX.XX.XXX
e1000g0:3: flags=1000843 mtu 1500 index 2 inet XXX.XXX.XX.XXX netmask ffffff00 broadcast XXX.XXX.XX.XXX

That's it! you're done.

In case you want to remove the interface -

To remove the interface from a running zone. From the global zone, remove the interface. You must first determine which logical interface [alias] you wish to remove.

# ifconfig e1000g0:3 down
# ifconfig e1000g0:3 unplumb
# zonecfg -z zone1
zonecfg:slabzone1> remove net address=XXX.XXX.XX.XXX
zonecfg:slabzone1> commit
zonecfg:slabzone1> exit

All Done Now you can enjoy your newly added interface lol :)

Cracking Kerberos Service Tickets (TGS) Using Kerberoasting

As of late I've been spending a lot of time researching and learning different techniques when it comes to attacking Active Directory En...