/etc/ftpaccess | ftpd configuration file |
/etc/ftpconversions | ftpd conversions database |
/etc/ftphosts | ftpd individual user host access file |
/etc/ftpusers | list of users disallowed any ftp access |
指令: allow <username> <addrglob> [<addrglob> ...] deny <username> <addrglob> [<addrglob> ...] <addrglob>是格式可以是: address/cidr 或 address:netmask 比如192.168.8.0/24和192.168.8.0:255.255.255.0
例子: :.Z: : :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESSftp当前目录下有个文件名为test.Z, 用户ftp登陆后使用
get test真正下载得到的文件为compress -d -c test.Z的结果.
class all real,guest,anonymous * email root@localhost loginfails 5 readme README* login readme README* cwd=* message /welcome.msg login message .message cwd=* compress yes all tar yes all chmod no guest,anonymous delete no guest,anonymous overwrite no guest,anonymous rename no guest,anonymous log transfers anonymous,real inbound,outbound shutdown /etc/shutmsg passwd-check rfc822 warn
class <class> <typelist> <addrglob> [<addrglob> ...]
email: 定义ftp管理员的email地址
loginfails 5: 5次错误登录之后, 记录错误信息,
关闭连接
readme README* login readme README* cwd=* message /welcome.msg login message .message cwd=* readme <path> {<when> <class>} message <path> {<when> <class>}
%T local time (form Thu Nov 15 17:12:42 1990) %F free space in partition of CWD (kbytes) [not supported on all systems] %C current working directory %E the maintainer's email address as defined in ftpaccess %R remote host name %L local host name %u username as determined via RFC931 authentication %U username given at login time %M maximum allowed number of users in this class %N current number of users in this class %B absolute limit on disk blocks allocated %b preferred limit on disk blocks %Q current block count %I maximum number of allocated inodes (+1) %i preferred inode limit %q current number of allocated inodes %H time limit for excessive disk use %h time limit for excessive files
chmod no guest,anonymous delete no guest,anonymous overwrite no guest,anonymous rename no guest,anonymous设置操作权限
shutdown /etc/shutmsg设置shutdown文件. 如果ftpd检测到/etc/shutmsg则在打印该文件后关闭连接.
passwd-check rfc822 warn
缺省的sendmail.mc文件(redhat对应文件在/etc/sendmail.mc)
divert(-1) dnl This is the macro config file used to generate the /etc/sendmail.cf dnl file. If you modify thei file you will have to regenerate the dnl /etc/sendmail.cf by running this macro config through the m4 dnl preprocessor: dnl dnl m4 /etc/sendmail.mc > /etc/sendmail.cf dnl dnl You will need to have the sendmail-cf package installed for this to dnl work. include(`/usr/lib/sendmail-cf/m4/cf.m4') define(`confDEF_USER_ID',``8:12'') OSTYPE(`linux') undefine(`UUCP_RELAY') undefine(`BITNET_RELAY') define(`confAUTO_REBUILD') define(`confTO_CONNECT', `1m') define(`confTRY_NULL_MX_LIST',true) define(`confDONT_PROBE_INTERFACES',true) define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail') FEATURE(`smrsh',`/usr/sbin/smrsh') FEATURE(`mailertable',`hash -o /etc/mail/mailertable') FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable') FEATURE(redirect) FEATURE(always_add_domain) FEATURE(use_cw_file) FEATURE(local_procmail) MAILER(procmail) MAILER(smtp) FEATURE(`access_db') FEATURE(`blacklist_recipients') dnl We strongly recommend to comment this one out if you want to protect dnl yourself from spam. However, the laptop and users on computers that do dnl not hav 24x7 DNS do need this. FEATURE(`accept_unresolvable_domains') FEATURE(`relay_local_from') dnl FEATURE(`relay_based_on_MX')dnl后面直到行末, 都会被m4忽略, 相当于m4文件中的注释
include(`/usr/lib/sendmail-cf/m4/cf.m4')
指定sendmail-cf的安装路径
define(`confAUTO_REBUILD')
confAUTO_REBUILD -
自动刷新aliases数据库.
define(`confTO_CONNECT', `1m')
confTO_CONNECT -
Timeout.connect,
连接超时为1分钟
define(`confTRY_NULL_MX_LIST',true)
confTRY_NULL_MX_LIST -
和邮件陆游算法有关系
define(`confDONT_PROBE_INTERFACES',true)
confDONT_PROBE_INTERFACES
-
不绑定interface
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')
PROCMAIL_MAILER_PATH
- 设置procmail的路径
FEATURE(`smrsh',`/usr/sbin/smrsh')
指定smrsh的路径
FEATURE(`mailertable',`hash
-o
/etc/mail/mailertable')
指定使用mailertable数据库
FEATURE(`virtusertable',`hash
-o
/etc/mail/virtusertable')
指定使用virtusertable数据库
FEATURE(redirect)
允许redirect功能
FEATURE(always_add_domain)
always_add_domain将foo@domain作为本地邮件
FEATURE(use_cw_file)
use_cw_file指定使用sendmail.cw
sendmail.cw保存所有的本地机器名
FEATURE(local_procmail)
使用procmail作为本地邮递器
FEATURE(`access_db')
使用access数据库
FEATURE(`blacklist_recipients')
同时适用于发送者与接收者
FEATURE(`accept_unresolvable_domains')
接收那些无法解析域名的邮件
FEATURE(`relay_local_from')
转发user@localdomain发来的邮件
. esmtp:[mail.tsinghua.edu.cn] foo.com esmtp:[mail1.foo.com] .foo.com esmtp:[mail2.foo.com] bar.org esmtp:other.mail.com可以看出来, mailertable中的每条邮件路由为两列. 前面一列
Example: info@foo.com foo-info info@bar.com bar-info @baz.org kite@any.where这样发给info@foo.com的邮件, 都将被传发给foo-info用户, 相同的 info@bar.com的邮件将会转发给bar-info用户, 所由发给@baz.org 的用户, 将转发给kite@any.where.
ssh stream tcp nowait root /usr/sbin/tcpd ssh -i然后重新起动inetd就可以了.
sshd的配置文件( /etc/ssh/sshd_config)
# This is ssh server systemwide configuration file. Port 22 #Protocol 2,1 ListenAddress 0.0.0.0 #ListenAddress :: HostKey /etc/ssh/ssh_host_key ServerKeyBits 768 LoginGraceTime 600 KeyRegenerationInterval 3600 PermitRootLogin yes # # Don't read ~/.rhosts and ~/.shosts files IgnoreRhosts yes # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication #IgnoreUserKnownHosts yes StrictModes yes X11Forwarding no X11DisplayOffset 10 PrintMotd yes KeepAlive yes # Logging SyslogFacility AUTH LogLevel INFO #obsoletes QuietMode and FascistLogging RhostsAuthentication no # # For this to work you will also need host keys in /etc/ssh_known_hosts RhostsRSAAuthentication no # RSAAuthentication yes # To disable tunneled clear text passwords, change to no here! PasswordAuthentication yes PermitEmptyPasswords no # Uncomment to disable s/key passwords #SkeyAuthentication no # To change Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #AFSTokenPassing no #KerberosTicketCleanup no # Kerberos TGT Passing does only work with the AFS kaserver #KerberosTgtPassing yes CheckMail no UseLogin no #Subsystem sftp /usr/local/sbin/sftpd
scp 的使用方法 scp [-pqrvC46] [-P port] [-c cipher] [-i identity_file] [[user@]host1:]file1 [...] [[user@]host2:]file2使用ssh-keygen生成key
ssh-keygen -f ~/.ssh/identity; cat ~/.ssh/identity.pub | \ ssh user@remote "mkdir ~/.ssh; > ~/.ssh/authorized_keys ; \ chmod 400 ~/.ssh/authorized_keys"