FTP Server Di Solaris 11

Saya punya server Solaris 11 dengan hostname ncc-dev-sms01. Saat saya ingin mencoba mengakses server ini melalui FTP tapi saya mendapati error seperti ini :

root@slc03dto:~# ftp ncc-dev-sms01
ftp: connect: Connection refused
ftp> quit
root@slc03dto:~# 

Error seperti itu dapat dipastikan karena servis FTP server di ncc-dev-sms01 belum aktif. Ketika saya cek di server ncc-dev-sms01 memang tidak terlihat ada servis FTP yang sedang aktif :

root@ncc-dev-sms01:~# svcs | grep -i ftp
root@ncc-dev-sms01:~#

Saya coba aktifkan dengan perintah svcadm enable tapi mendapati error seperti ini :

root@ncc-dev-sms01:~# svcadm enable ftp
svcadm: svc:/network/ftp:default: is not complete, missing general/complete (see svcs -xv svc:/network/ftp:default for details)
root@ncc-dev-sms01:~# 

Mengikuti petunjuk yang muncul saya gunakan perintah svcs -xv tersebut :

root@ncc-dev-sms01:~# svcs -xv svc:/network/ftp:default
svc:/network/ftp:default (?)
 State: -
Reason: Service is incomplete, defined only by profile /etc/svc/profile/generic.xml.  To install this service, identify and install the package which provides the service's primary manifest.  Use "pkg search 'svc\:/network/ftp\:default'" to identify the package, then "pkg install <pkg>" to install the indicated package.
Impact: This service is not running.
root@ncc-dev-sms01:~# 

Untuk memasang servis FTP yang belum ada tadi, saya gunakan perintah seperti di bawah ini :

root@ncc-dev-sms01:~# pkg install pkg://solaris/service/network/ftp
           Packages to install:  1
       Create boot environment: No
Create backup boot environment: No
            Services to change:  2


DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                1/1       112/112      0.8/0.8  2.1M/s


PHASE                                          ITEMS
Installing new actions                       179/179
Updating package state database                 Done
Updating image state                            Done
Creating fast lookup database                   Done
root@ncc-dev-sms01:~# 

Setelah servis tersebut aktif, saya bisa mengulang kembali perintah svcadm enable tadi :

root@ncc-dev-sms01:~# svcadm enable ftp
root@ncc-dev-sms01:~# svcs | grep -i ftp
online          3:52:46 svc:/network/ftp:default
root@ncc-dev-sms01:~#

Setelah servis ini aktif saya bisa melihat servis FTP sudah LISTEN di port 21 :

root@ncc-dev-sms01:~# netstat -an | egrep "21.*LISTEN"
  *.21                 *.*                0      0 128000      0 LISTEN
  *.21                              *.*                             0      0 128000      0 LISTEN      
root@ncc-dev-sms01:~#

Dengan begitu sekarang saya sudah bisa mengakses server ini melalui perintah FTP :

root@slc03dto:~# ftp ncc-dev-sms01
Connected to ncc-dev-sms01.
220 ::ffff:192.168.1.11 FTP server ready
Name (ncc-dev-sms01:ttirtawi): smf_oper
331 Password required for smf_oper
Password:
230 User smf_oper logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 

Untuk membatasi user yang tidak boleh mengakses FTP server ini, saya bisa menambahkan username yang bersangkutan dalam berkas berikut ini :

root@ncc-dev-sms01:~# cat /etc/ftpd/ftpusers 
#
# List of users denied access to the FTP server, see ftpusers(4).
#
root
daemon
bin
sys
adm
lp
uucp
nuucp
dladm
netadm
netcfg
smmsp
gdm
xvm
mysql
openldap
webservd
nobody
noaccess
nobody4
aiuser
unknown
ftp
root@ncc-dev-sms01:~# 

Demikian catatan singkat saya tentang cara mengaktifkan FTP server di Solaris 11. Langkah-langkah ini bisa dilakukan pada global zone maupun dari dalam local zone.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.