2。修改telnet服务配置文件
vi
/etc/xinetd.d/telnet
service
telnet{disable
=
yes
flags
=
REUSE
socket_type
=
streamwait
=
nouser
=
root
server
=
/usr/sbin/in.telnetd
log_on_failure
+=
USERID}将disable=yes行前加#,或者改为disable=no
3。重新启动xinetd守护进程
由于telnet服务也是由xinetd守护的,所以安装完telnet-server,要启动telnet服务就必须重新启动xinetd
[root@localhost
root]#service
xinetd
restart
4。关闭系统的防火墙
linux系统默认的防火墙是“high”。
(方法:[root@localhost
root]#
setup
选择:“firewall
configuration”
选择:security
level——“no
firewall”)
5。如果想允许root以telnet登入linux主机?因为
telnet
不是很安全,自然预设的情况之下就是无法允许
root
以
telnet
登入
Linux
主机!想要开放
root
以
telnet
登入
Linux
主机的话,可以这样做:
在
auth
required
/lib/security/pam_securetty.so
这行前加
#
,即把这行注释掉就行
最简单的方法是新建一个不允许登陆的系统用户:useradd sydsftp -s /sbin/nologin
passwd sydsftp设置密码
再给/var/ftp目录授权
chown sydsftp:sydsftp /var/ftp
修改vsftp配置文件,允许匿名用户可读,允许本地用户可读可写:
vi /etc/vsftp/vsftpd.conf
anonymous_enable=YES
anon_upload_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES 将FTP本地用户禁锢在宿主目录中
anon_root=/var/ftp 设置主目录
local_root=/var/ftp 设置本地用户主目录
回答这个问题很蛋疼啊有一部分参考了插件calendar.vm
将下面2个函数放入vimrc或者在plugin文件夹新建一个.vim文件
调用:
:call Reply_Baidu()<cr>
function MY_Calendar(vyear,vmnth)
" get arguments
let vyear = a:vyear
let vmnth = a:vmnth
" start with last 6 month
let vmnth = vmnth - 6
if vmnth <1
let vmnth = 12 - vmnth
let vyear = vyear - 1
endif
" reset display variables
let vmcnt = 0
while vmcnt <12
let vcolumn = 22
let vnweek = -1
"--------------------------------------------------------------
"--- calculating
"--------------------------------------------------------------
" set boundary of the month
if vmnth == 1
let vmdays = 31
let vparam = 1
let vsmnth = 'Jan'
elseif vmnth == 2
let vmdays = 28
let vparam = 32
let vsmnth = 'Feb'
elseif vmnth == 3
let vmdays = 31
let vparam = 60
let vsmnth = 'Mar'
elseif vmnth == 4
let vmdays = 30
let vparam = 91
let vsmnth = 'Apr'
elseif vmnth == 5
let vmdays = 31
let vparam = 121
let vsmnth = 'May'
elseif vmnth == 6
let vmdays = 30
let vparam = 152
let vsmnth = 'Jun'
elseif vmnth == 7
let vmdays = 31
let vparam = 182
let vsmnth = 'Jul'
elseif vmnth == 8
let vmdays = 31
let vparam = 213
let vsmnth = 'Aug'
elseif vmnth == 9
let vmdays = 30
let vparam = 244
let vsmnth = 'Sep'
elseif vmnth == 10
let vmdays = 31
let vparam = 274
let vsmnth = 'Oct'
elseif vmnth == 11
let vmdays = 30
let vparam = 305
let vsmnth = 'Nov'
elseif vmnth == 12
let vmdays = 31
let vparam = 335
let vsmnth = 'Dec'
else
echo 'Invalid Year or Month'
return
endif
if vyear % 400 == 0
if vmnth == 2
let vmdays = 29
elseif vmnth >= 3
let vparam = vparam + 1
endif
elseif vyear % 100 == 0
if vmnth == 2
let vmdays = 28
endif
elseif vyear % 4 == 0
if vmnth == 2
let vmdays = 29
elseif vmnth >= 3
let vparam = vparam + 1
endif
endif
" calc vnweek of the day
if vnweek == -1
let vnweek = ( vyear * 365 ) + vparam
let vnweek = vnweek + ( vyear/4 ) - ( vyear/100 ) + ( vyear/400 )
if vyear % 4 == 0
if vyear % 100 != 0 || vyear % 400 == 0
let vnweek = vnweek - 1
endif
endif
let vnweek = vnweek - 1
endif
" fix Gregorian
if vyear <= 1752
let vnweek = vnweek - 3
endif
let vnweek = vnweek % 7
"--------------------------------------------------------------
"--- displaying
"--------------------------------------------------------------
" build header
let vdisplay2=vyear.'/'.vmnth.'('
let vdisplay2=strpart(" ",
\ 1,(vcolumn-strlen(vdisplay2))/2-2).vdisplay2
let vdisplay2=vdisplay2.vsmnth.')'."\n"
let vwruler = "Su Mo Tu We Th Fr Sa"
let vdisplay2 = vdisplay2.' '.vwruler."\n"
" build calendar
let vinpcur = 0
while (vinpcur <vnweek)
let vdisplay2=vdisplay2.' '
let vinpcur = vinpcur + 1
endwhile
let vdaycur = 1
let vdisplay2 = vdisplay2.' '
while (vdaycur <= vmdays)
if vmnth <10
let vtarget =vyear."0".vmnth
else
let vtarget =vyear.vmnth
endif
if vdaycur <10
let vtarget = vtarget."0".vdaycur
else
let vtarget = vtarget.vdaycur
endif
let vsign = ''
if vdaycur <10
let vdisplay2=vdisplay2.' '
endif
let vdisplay2=vdisplay2.vdaycur
let vdaycur = vdaycur + 1
" fix Gregorian
if vyear == 1752 &&vmnth == 9 &&vdaycur == 3
let vdaycur = 14
endif
let vinpcur = vinpcur + 1
if vinpcur % 7 == 0
let vdisplay2=vdisplay2."\n"
endif
let vdisplay2 = vdisplay2.' '
endwhile
let vmnth = vmnth + 1
let vmcnt = vmcnt + 1
if vmnth >12
let vmnth = 1
let vyear = vyear + 1
endif
silent put =vdisplay2
endwhile
return
endfunction
function Reply_Baidu()
exe "normal ggdG"
"插入日历
call MY_Calendar(2009,7)
exe "w 2009.txt"
"标题变为2009全年日历
call append(1,"\t2009 Calendar")
"每个月的行数
let jan = search("Jan")
let feb = search("Feb")
let mar = search("Mar")
let apr = search("Apr")
let may = search("May")
let jun = search("Jun")
let jul = search("Jul")
let aug = search("Aug")
let sep = search("Sep")
let oct = search("Oct")
let nov = search("Nov")
let dec = search("Dec")
"移动4-6月
let line = apr
while line <jul
call cursor(line,1)
exe ">"
let line = line + 1
endwhile
"删除123 再恢复 这不蛋疼么
let line = apr-jan
call cursor(jan,1)
exe "normal d".line."d"
exe "normal kp"
"7 8 9 移动到最后
let line = oct - jul
call cursor(jul,1)
exe "normal d".line."d"
exe "normal Gp"
"检测30 并删除
let line = 1
echo line('$')
while line <= line('$')
if getline(line) =~ '\<30\>'
if getline(line) =~ '\<31\>' || getline(line+1) =~ '\<31\>'
let line = line + 1
continue
else
call cursor(line,1)
exe "normal f3d$"
endif
endif
let line = line + 1
endwhile
"最后保存
exe "w 2009.txt"
endfunction
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)