This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

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

Tuesday, June 28, 2011

.::: How To Setting Remote, Telnet, SSH, FTP, Xbrowser, IP, Hostname, Patch, Alias After Fresh Installation Solaris 8, 9, 10 :::.

Bagamana cara Setting Remote, Telnet, SSH, FTP, Xbrowser, IP, Hostnamem, Patch, Alias setelah Install Solaris 8, 9, 10



Solaris

Sample IP 10.10.10.10 netmask 255.255.255.0 gateway 10.10.10.1

1. Check Netmask

bash-3.00# more /etc/netmasks
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
#       network-number  netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
#               128.32.0.0 255.255.255.0
#
10.10.10.0    255.255.255.0
bash-3.00#

2. Check Hostname

bash-3.00# more /etc/hosts
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
10.10.10.10 teguhhostname teguhhostname. loghost
bash-3.00# more /etc/hostname
teguhhostname

3. Check IP Gateway  /Router

bash-3.00# more /etc/defaultrouter
10.10.10.1
bash-3.00#

4. Mengaktifkan remote

bash-3.00# more /etc/default/login
di ubah dari CONSOLE=/dev/console menjadi  #CONSOLE=/dev/console

bash-3.00# more /etc/default/login
#ident  "@(#)login.dfl  1.14    04/06/25 SMI"
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.

# Set the TZ environment variable of the shell.
#
#TIMEZONE=EST5EDT

# ULIMIT sets the file size limit for the login.  Units are disk blocks.
# The default of zero means no limit.
#
#ULIMIT=0

# If CONSOLE is set, root can only login on that device.
# Comment this line out to allow remote login by root.
#
#CONSOLE=/dev/console

.............
bash-3.00#

5. Mengaktifkan SSH

bash-3.00# more /etc/ssh/sshd_config
Ubah # PermitRootLogin no menjadi # PermitRootLogin yes

bash-3.00# more /etc/ssh/sshd_config
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)sshd_config        1.8     04/05/10 SMI"
#
.....................
# Are root logins permitted using sshd.
# Note that sshd uses pam_authenticate(3PAM) so the root (or any other) user
# maybe denied access by a PAM module regardless of this setting.
# Valid options are yes, without-password, no.
PermitRootLogin yes

# sftp subsystem
Subsystem       sftp    /usr/lib/ssh/sftp-server
...................
bash-3.00# init 6

6. Mengaktifkan FTP (File Transfer Protocol)

bash-3.00# more /etc/ftpd/ftpusers
Ubah root menjadi #root

bash-3.00# more /etc/ftpd/ftpusers
# ident "@(#)ftpusers   1.5     04/02/20 SMI"
#
# List of users denied access to the FTP server, see ftpusers(4).
#
#root
daemon
bin
sys
adm
lp
uucp
nuucp
smmsp
listen
gdm
webservd
nobody
noaccess
nobody4
bash-3.00#

bash-3.00# more /etc/services
tambahkan port 177/udp , 177/tcp & 6000-6010/tcp

bash-3.00# more /etc/services
#
# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#ident  "@(#)services   1.34    08/11/19 SMI"
#
# Network services, Internet style
#
tcpmux          1/tcp
.........

xxxx_5006    5006/tcp
xxxx_161    161/udp
xxxx_162    162/udp
#======== Teguh Triharto Corporation reserved ports ends ========
bash-3.00#


bash-3.00# svcadm enable telnet
bash-3.00# svcadm enable ssh
bash-3.00# svcadm enable ftp
bash-3.00# /usr/dt/bin/dtconfig -e
done
desktop auto-start enabled.
bash-3.00#

tidak perlu di restart kecuali untuk mgaktifkan SSH <bash-3.00#init 6>

6. Patching
====================================================
untuk patching< contoh untuk mengecek SUNWi15cs>

#pkginfo SUNWi15cs atau bisa pakai #pkginfo | grep SUNWi15cs

bash-3.00# pkginfo SUNWi15cs
ERROR: information for "SUNWi1s5cs" was not found
bash-3.00#

Hasil di atas. bahwa patch SUNWi15cs belum ada
untuk patching< contoh untuk install SUNWi15cs> cara 1

bash-3.00# pkginfo SUNWi15cs
system      SUNWi15cs X11 ISO8859-15 Codeset Support

Hasil di atas. bahwa patch SUNWi15cs belum ada
bash-3.00# pkgadd -d /cdrom/sol_10_1009_x86/Solaris_10/Product/ SUNWi15cs

Processing package instance <SUNWi15cs> from </cdrom/sol_10_1009_x86/Solaris_10/Product>

X11 ISO8859-15 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.

This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.

Using </> as the package base directory.
## Processing package information.
## Processing system information.
   21 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <SUNWi15cs> [y,n,?] y
====================================================
untuk patching< contoh untuk install SUNWi15cs> cara 2<masuk ke directory /cdrom/sol_10_1009_x86/Solaris_10/Product/>
bash-3.00# cd /cdrom/sol_10_1009_x86/Solaris_10/Product/
bash-3.00# pwd
/cdrom/sol_10_1009_x86/Solaris_10/Product
bash-3.00# pkgadd -d . SUNWi15cs

Processing package instance <SUNWi15cs> from </cdrom/sol_10_1009_x86/Solaris_10/Product>

X11 ISO8859-15 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.

This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.

Using </> as the package base directory.
## Processing package information.
## Processing system information.
   21 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <SUNWi15cs> [y,n,?]

7. name alias ( Mengubah Tampilan Name Command Promt /CLI)

Untuk Manual dimana jika ada perubahan Hostname maka .profile harus di ubah manual

Connected to 10.10.10.10 (10.10.10.10).
Escape character is '^]'.
login: root
Password:
Last login: Fri Jul  1 09:05:58 from 202.134.3.122
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
You have new mail.
bash-3.00# bash
bash-3.00# vi .profile
".profile" 2 lines, 34 characters
PS1='root@teguhhostname #'
export PS1
~
~
:wq!


close CLI / Terminal and then open CLI /Terminal


root@teguhhostname #more .profile
PS1='root@teguhhostname #'
export PS1
root@teguhhostname #

Untuk Automatis dimana jika ada perubahan Hostname maka Command Prompt/Terminal akan berubah sesuai hostname tanpa perlu mengubah .profile

Download .profile and .profile-EIS  adn copy .profile and .profile-EIS and extract ke directory root ( / )
bash-3.00#pwd
/
bash-3.00#

sample command ada di bawah. 

bash-3.00# vi .profile
#
# Initial EIS settings for user root
# This file is set up by the setup-standard script.
#
# In the unlikely event that the EIS profile settings are not
# required, comment out the few lines below.
#
# Version 11JUL05
#

#
#       Source the EIS settings if present
#
if [ -f $HOME/.profile-EIS ]
then
    echo "Sourcing $HOME/.profile-EIS....."
    . $HOME/.profile-EIS
fi

#
#       Remove #NOHEAD from next section for cluster node or domain
#       If you do not use a vt100 change it to your terminal type.
#
#NOHEAD if [ "`tty`" != "not a tty" ]
#NOHEAD then
#NOHEAD     if [ "`tty`" = "/dev/console" ]
#NOHEAD     then
#NOHEAD         TERM=vt100
#NOHEAD         export TERM
#NOHEAD         echo ""
#NOHEAD         echo "TERM=$TERM"
#NOHEAD         echo ""
#NOHEAD     else
#NOHEAD         LOGINFROM=`who am i | cut -f2 -d"(" | cut -f1 -d")"`
#NOHEAD         DISPLAY=${LOGINFROM}:0.0
#NOHEAD         export LOGINFROM DISPLAY
#NOHEAD         echo ""
#NOHEAD         echo "DISPLAY=$DISPLAY"
#NOHEAD         echo ""
#NOHEAD     fi
#NOHEAD fi
export PATH=$PATH:/usr/local/bin
:wq!
bash-3.00#
buka Terminal CLI lalu telnet ke server dan hasilnya

teguhhostname #

8. Check Alias (Tampilan CLI)

buka Terminal CLI lalu telnet ke server dan hasilnya

teguhhostname #
login: root
Password:
Last login: Tue Jun 28 16:00:12 from 10.10.10.20
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
You have new mail.
Sourcing //.profile-EIS.....
teguhhostname # bash
teguhhostname # ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index
 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index
 2
        inet 10.10.10.10 netmask ffffffe0 broadcast 10.10.10.255
        ether 0:14:4f:af:2a:60
teguhhostname #



Wednesday, June 22, 2011

.::: Solaris Network Configuration :::.

Setting up Solaris networking often becomes challenging for the new sysadmins and new owners of Sun systems . This document details the steps involved in setting up of Solaris networking and can be used as a check list if you are already familiar with Solaris network configuration .

Table of contents :

1. Enable the network card
2. Configuring ipaddress and netmask and making the interface status as up .
3. Configuring Virtual interface :
4. Ip-forwarding
5. Router Configuration
6. Network Terms
7. Next Steps
Ifconfig command is used in Solaris to configure the network interfaces . The following lines describes the activities needed to configure a freshly installed network card from the root prompt .

1. Enable the network card

#ifconfig hme0 plumb 

ifconfig -a command should show following type of output which means device is enabled and is ready to configure ip address and netmask :
hme0: flags=842 mtu 1500
inet 0.0.0.0 netmask 0
ether 3:22:11:6d:2e:1f 

2. Configuring ipaddress and netmask and making the interface status as up .

#ifconfig hme0 192.9.2.106 netmask 255.255.255.0 up 
 
#ifconfig -a will now show the ip address , netmask and up status as follows :
hme0: flags=843 mtu 1500
inet 192.9.2.106 netmask ffffff00 broadcast 192.9.2.255
ether 3:22:11:6d:2e:1f 

The file /etc/netmasks is used to define netmasks for ip addresses .
127.0.0.1, is the standard loop back route and 127.0.0.0 is the default loopback ipaddress used by the kernel when no interface is configured this will be the only entry displayed by the system on invoking ifconfig -a command..

3. Configuring Virtual interface
Virtual interface can be configured to enable hme0 reply to more then one ip addresses. This is possible by using hme0 alias which can be configured by ifconfig command only . The new alias device name now becomes hme0:1 hme:2 etc.

#ifconfig hme0:1 172.40.30.4 netmask 255.255.0.0 up 

ifconfig -a will show the original hme0 and alias interface :
hme0: flags=843 mtu 1500
inet 192.9.2.106 netmask ffffff00 broadcast 192.9.2.255
ether 3:22:11:6d:2e:1f
hme0:1: flags=842 mtu 1500
inet 172.40.30.4 netmask ffff0000 broadcast 172.40.255.255 

4. Ip-forwarding
IP forwarding allows you to forward all requests coming for a certain port or URL to be redirected to a specified IP address.
ip forwarding becomes enabled automatically when system detects more then one interface at the booting time . The file involved is /etc/rc2.d/S69inet .

ipforwarding is on by default but can be turned off by following command :

#ndd -set /dev/ip ip_forwarding 0 

5. Router Configuration
After interfaces and ipaddess have been configured the system needs a default router which will allow the machine to talk to world outside of local network .
You can specify a particular route for a particular address as in following example 

#route add -net 10.0.0.0 -netmask 255.0.0.0 172.40.30.1 1

if the the destination ipaddess is not defined in this manner system forwards all requests to the default router .

default route is defined manually by editing /etc/defaultrouter file and putting router’s ipaddress entry in it. This file is read by /etc/rc2.d/S69inet file during the booting process and entry added to the routing table .

The route can be defined online also using routeadd command but the changes will be lost on reboot .To make changes permanent make sure to put an entry in /etc/defaultrouter.

#route add default 205.100.155.2 1

#route change default 205.100.155.2 1

The 1 at the end is the number of hops to the next gateway.
If an interface is not responding to the network, check to be sure it has the correct IP address and netmask , network cables are fine .

6. Network Terms

CIDR
CIDR : Classless Inter-Domain Routing – the notation often used instead of writing the subnet mask along with ip-address . It has network prefix at the end of a address as / number of network bits.This means that the IP address 192.200.20.10 with the subnet mask 255.255.255.0 can also be expressed as 192.200.20.10/24. The /24 indicates the network prefix length, which is equal to the number of continuous binary one-bits in the subnet mask (11111111.11111111.11111111.000000). Zeros are for addressing the hosts on this network.

VLSM
network can be variably subnetted into smaller networks, each smaller network having a different subnet mask .This functionality is avaiable in Solaris 2.6 above. the ipaddresses

source http://fakta-dan-unik.blogspot.com & http://teguhtriharto.blogspot.com

.::: How To: Add a Static Route (persistent) in Sun Solaris :::.

Bagaimana menambahkan Static Router pada Solaris 8, 9, 10
To add a Static Route in Sun Solaris operating system, you can use the route command. This will dynamically update the Kernel IP Routing table. However, when a server is restarted, these routes will be lost. To prevent this from happening, add a startup script S76static-routes with all the route commands for the static route that needs to persist. This will ensure that the route gets added at boot time.


To use the route command,

Syntax:
# route add [net|host] <Addr> netmask <Mask> [GatewayAddr|-interface ] <metric>
Example:
Add a network
# route add net 10.10.10.0 netmask 255.255.255.0 192.168.1.1 1
same as
# route add 10.10.10.0/24 192.168.1.1 1
Add a host
# route add host 1.1.1.1 netmask 255.255.255.0 192.168.1.1 1
same as
# route add 1.1.1.1/24 192.168.1.1 1
To route the traffic through an interface instead of an IP Gateway
# route add 1.1.1.1/24 -interface hme0
To check that the roots are added to Kernel IP Routing table,
# netstat -rn
Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
——————– ——————– —– —– —— ———
192.168.1.0          192.168.1.1        U         1    273  hme0
224.0.0.0            192.168.1.1         U         1      0   hme0
default              192.168.1.1          UG        1    196
Static Routes at boot time

To make the routes available at boot time so the next time when the server reboots, the routes are still available. Add a startup script named as
/etc/rc2.d/S76static-routes
and add the required route commands as above.
Change the permissions for the file so that the file is executable by root.
# chmod 744 /etc/rc2.d/S76static-routes
This should help.
Have I missed something? Have I made a mistake? please let me know by leaving a comment!

source http://fakta-dan-unik.blogspot.com & http://teguhtriharto.blogspot.com