星期一, 1 二月 2010
修改Solaris 10自带ftpd的默认文件掩码
« UNIX 文件的七种类型 | Main | dos2unix 和unix2dos »Solaris自带的ftpd是WU-FTPD,使用 SMF管理来启动和停止。默认文件上传使用的umask是022,如果需要修改怎么办呢?ftpaccess文件中设置的umask是是否允许用户执行 umask,达不到我们的目的。这个就需要修改ftpd的启动参数,因此需要ftpd有关的smf配置信息。
通过svccfg修改有关ftpd配置的inetd_start/exec参数,例如
setprop inetd_start/exec = astring:"/usr/sbin/in.ftpd -a -u 077 "
下面是定义ftp服务的xml文件。
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<!--
Copyright 2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
ident "@(#)ftp.xml 1.4 04/12/09 SMI"
NOTE: This service manifest is not editable; its contents will
be overwritten by package or patch operations, including
operating system upgrade. Make customizations in a different
file.
Service manifest for in.ftpd
-->
<service_bundle type='manifest' name='SUNWftpr:ftp'>
<service
name='network/ftp'
type='service'
version='1'>
<create_default_instance enabled='false' />
<restarter>
<service_fmri value='svc:/network/inetd:default' />
</restarter>
<exec_method
type='method'
name='inetd_start'
exec='/usr/sbin/in.ftpd -a'
timeout_seconds='0'>
<method_context>
<method_credential user='root' group='root' />
</method_context>
</exec_method>
<exec_method
type='method'
name='inetd_disable'
exec=':kill'
timeout_seconds='0'>
</exec_method>
<property_group name='inetd' type='framework'>
<stability value='Evolving' />
<propval name='endpoint_type' type='astring' value='stream' />
<propval name='name' type='astring' value='ftp' />
<propval name='proto' type='astring' value='tcp6' />
<propval name='wait' type='boolean' value='false' />
<propval name='isrpc' type='boolean' value='false' />
</property_group>
<stability value='Unstable' />
<template>
<common_name>
<loctext xml:lang='C'>
FTP server
</loctext>
</common_name>
<documentation>
<manpage title='in.ftpd' section='1M'
manpath='/usr/share/man' />
<manpage title='ftpd' section='1M'
manpath='/usr/share/man' />
</documentation>
</template>
</service>
</service_bundle>
Posted by at 7:14 下午 in 未分类
[Trackback URL for this entry]