Ads 468x60px

วันศุกร์ที่ 11 พฤศจิกายน พ.ศ. 2554

Solaris10 - notes

Solaris10 - notes


Changing IP address

/etc/hosts
/etc/hostname.bge0
/etc/resolv.conf
/etc/netmasks
/etc/nodename
/etc/defaultrouter
/etc/inet/ipnodes

TFTPd setup

In  /etc/inetd.conf - uncommented the line
TFTPD - tftp server
tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot
Run these commands to convert inetd.conf entries into smf service manifests, import them into smf repository and check its taken

root# inetconv
root# svcs | grep tftp
online 16:15:58 svc:/network/tftp/udp6:default

  • Enable using inetadm -e svc:/network/tftp/udp6
  • Disable with inetadm -d svc:/network/tftp/udp6

Wrap the service to only allow from SWERN address space

Solaris 10 comes with TCP Wrappers included: Enable using:

inetadm -M tcp_wrappers=true
svcadm refresh inetd


Check using

# svcprop -p defaults inetd
defaults/tcp_wrappers boolean true 

Can also set for inetd-based services using

svccfg -s inetd setprop defaults/tcp_wrappers=true
svcadm refresh inetd

 /etc/hosts.allow and /etc/hosts.deny now configures as usual.
 All fine - except this doesn't work for TFTP
Use IPfilters instead

mantoo IP addresses

 e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
        inet 194.83.94.62 netmask ffffffc0 broadcast 194.83.94.63
        ether 0:14:4f:4a:7:3e
nge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 192.168.243.182 netmask fffffc00 broadcast 192.168.243.255
        ether 0:14:4f:4a:7:3c

ifconfig e1000g0 194.83.94.62 netmask 255.255.255.192
ifconfig e1000g0 broadcast 194.83.94.63
 

เปิด FTP Server ใน Solaris 10

เปิด FTP Server ใน Solaris 10

วิธีการเปิด FTP Server ใน Solaris 10 นั้นค่อยข้างง่ายครับ
เนื่องจากโดยปกติการติดตั้ง Solaris 10 นั้นจะติดตั้ดตั้งตัว FTP Server มาให้พร้อมอยู่แล้ว

1.ลองใช้คำสั่งในการตรวจสอบ ดูก่อนว่าในเครื่องเรามี FTP Server อยู่หรือไม่
# inetadm -l network/ftp    ซึ่งคำสั่งนี้ใช้ในการตรวจสอบ status ของ service ครับ

2.จากนั้นใช้คำสั่ง svcadm เพื่อจัดการ service
ซึ่งมีรูปแบบตามนี้ครับ svcadm [operation] serivce_name
เช่น # svcadm enable network/ftp    //คำสั่งในการเปิด service
# svcadm restart network/ftp    //คำสั่งในการ restart service

3.ส่วนการจัดการเกี่ยวกับในส่วนของ user ที่จะ login เข้ามานั้นจะใช้ user ชุดเดียวกับ OS ครับ (รวมทั้ง Home Dir ด้วย ดูที่ /etc/passwd)

แต่เราสามารถกำหนดกฏ หรือการ Block ได้ดังนี้ครับ
3.1 การ block user นั้นสามารถเลือก block ได้โดยใส่ user name ของ user ที่เราต้องการ block ลงในไฟล์ /etc/ftpd/ftpusers
3.2 กฏต่างของ FTP Server จะอยู่ในไฟล์ /etc/ftpd/ftpaccess

Ssh in Solaris

Ssh in Solaris 

This post is about service ssh in solaris 9 or 10

Solaris 9
Disable service ssh ?

bash>  /etc/init.d/sshd stop
bash> /etc/rc3.d/S89sshd stop
 
Enable service ssh ?

bash> /etc/init.d/sshd start
bash> /etc/rc3.d/S89sshd start
 
Refresh service ssh ?

bash> kill -HUP `cat /var/run/sshd.pid`
 
Solaris 10
First you can check service ssh with command

bash> svcs | grep ssh
online         Jan_21   svc:/network/ssh:default
 
If status ssh offline, you can make online with command:

bash> svcadm enable -t network/ssh:default
bash> /lib/svc/method/sshd start
 
Disable service ssh ?

bash> svcadm disable -t network/ssh:default
 
Restart service ssh ?

bash> svcadm restart network/ssh:default
bash> /lib/svc/method/sshd restart
 
Refresh service ssh ?

bash> svcadm refresh network/ssh:default
 
For a root enable connect to host via ssh service

bash> vi /etc/ssh/sshd_config
[....]
# Valid options are yes, without-password, no.
PermitRootLogin no
[....]
 
Replace no with yes, after that save the edited configuration.
Don't forget for the restart service ssh, after edit configuration.

Blogger templates