【问题标题】:How check FTP anonymous connection如何检查 FTP 匿名连接
【发布时间】:2015-07-06 13:33:08
【问题描述】:

我想问一下linux中的ftp连接, 如何使用终端检查 linux 中的 ftp 匿名连接? 我使用while循环来读取vsftpd.conf文件,就像那样

 while read line 
   do
    if [ Anonymous_enable=YES ];
       then echo " Accept connection"
    elif [ Anonymous_enable=NO ];
      then echo "Not Accept"
fi
done<vsftpd.conf

【问题讨论】:

    标签: linux shell ftp terminal debian


    【解决方案1】:

    不确定为什么要使用 while 循环,但可以使用简单的 bash 脚本:

    #!/bin/bash
    X=`cat /etc/vsftpd | grep ^anonymous_enable | awk -F= '{print $2}'`
    shopt -s nocasematch
    if [[ $X = "YES" ]]
    then
            echo -e "Accept connection\n"
    else
            echo -e "Not Accept\n"
    fi
    

    输出:

    [root@ftp ~]# sh /tmp/anon_check.sh
    Accept connection
    

    【讨论】:

    • 如果有用别忘了回答。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-19
    • 2011-04-25
    • 1970-01-01
    • 2012-11-29
    • 2010-10-24
    相关资源
    最近更新 更多