Solaris10 使用svcadm管理系统服务,使用这个工具,可以enable、disable和维护系统服务。
enable/disable
[straylight] % svcs network/ssh
STATE STIME FMRI
online Sep_24 svc:/network/ssh:default
我们测试通过ssh方式连接straylight,ssh正常运行
[proxima-centauri] % ssh straylight
Password:********
现在disable ssh
[straylight] % svcadm disable network/ssh
[straylight] % svcs network/ssh
STATE STIME FMRI
disabled 0:56:48 svc:/network/ssh:default
The SMF CLI tools are as follows:
- inetadm - observe and configure services that are controlled by inetd.
- svcadm - service administration, including enabling, disabling, and restarting services
- svccfg - manipulate the contents of the repository, usually properties in a service
- svcprop - observe property values in a read-only manner. outputs are formalized for easy use in shell scripts.
- svcs - observe the state of all the service instances on the system, and detailed views of their dependencies, processes, etc.
在solaris 10下默认就是开放ftp和telnet服务的,可以先确认一下
bash-3.00# svcs|egrep ftp
online 23:26:42 svc:/network/ftp:default
bash-3.00# svcs|egrep telnet
online 23:26:42 svc:/network/telnet:default
如果看到上面信息说明已经开放,如果状态显示为offline,就必须手动开启服务
bash-3.00# svcadm enable ftp
bash-3.00# svcadm enable telnet