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 #