Centos 6.4上面用Shell脚本一键安装vsftpd

install.sh

#!/bin/bash

if [ `uname -m` == "x86_64" ];then
machine=x86_64
else
machine=i686
fi
ifrpm=$(cat /proc/version | grep -E "redhat|centos")
ifdpkg=$(cat /proc/version | grep -Ei "ubuntu|debian")
ifcentos=$(cat /proc/version | grep centos) if [ "$ifrpm" != "" ];then
yum -y install vsftpd
\cp -f ./config-ftp/rpm_ftp/* /etc/vsftpd/
else
apt-get -y install vsftpd
if cat /etc/shells | grep /sbin/nologin ;then
echo ""
else
echo /sbin/nologin >> /etc/shells
fi
\cp -fR ./config-ftp/apt_ftp/* /etc/
fi if [ ! -f '/etc/vsftpd' ];then
mkdir -p /etc/vsftpd
fi if [ "$ifcentos" != "" ] && [ "$machine" == "i686" ];then
rm -rf /etc/vsftpd/vsftpd.conf
\cp -f ./config-ftp/vsftpdcentosi686.conf /etc/vsftpd/vsftpd.conf
fi if [ ! -f '/storage/vsftpd' ];then
mkdir -p /storage/vsftpd
fi result="`grep '^vsftpd' /etc/passwd | wc -l`" if [ "$result" == "" ];then groupadd vsftpd useradd -g vsftpd -s /sbin/nologin vsftpd
fi /etc/init.d/vsftpd start chown -R vsftpd:vsftpd /storage/vsftpd #bug kill: '500 OOPS: vsftpd: refusing to run with writable root inside chroot()'
chmod a-w /storage/vsftpd MATRIX="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
LENGTH=""
while [ "${n:=1}" -le "$LENGTH" ]
do
PASS="$PASS${MATRIX:$(($RANDOM%${#MATRIX})):1}"
let n+=
done
if [ "$ifrpm" != "" ];then
echo $PASS | passwd --stdin vsftpd
else
echo "vsftpd:$PASS" | chpasswd
fi sed -i s/'ftp_password'/${PASS}/g account.log

完整脚本下载:http://pan.baidu.com/s/1o6E15oA

Centos 6.4上面用Shell脚本一键安装vsftpd的更多相关文章

  1. Centos 6.4上面用Shell脚本一键安装mysql 5.6.15

    Centos 6.4上面用Shell脚本一键安装mysql 5.6.15  #!/bin/bash if [ `uname -m` == "x86_64" ];then machi ...

  2. 安装完Ubuntu后通过shell脚本一键安装软件

    安装完Ubuntu后通过shell脚本一键安装软件 以下代码中#是单行注释 :<<! ! 是多行注释. 运行的时候需要把多行注释去掉. 比如把以下代码保存为install.sh, 那么在终 ...

  3. shell脚本一键安装mysql5.7.x

    使用脚本一键安装mysql5.7.x,初始化数据库.启动数据库---- mysql版本号:源代码mysql5.7.10 linux版本号:centos6.5 x86_64 #!/bin/bash GR ...

  4. shell脚本一键安装mysql5.7.x(免安装版)

    使用脚本一键安装mysql5.7.x,初始化数据库,启动数据库---- mysql版本:源码mysql5.7.10 linux版本:centos6.5 x86_64 #!/bin/bash GROUP ...

  5. Shell脚本一键安装LNMP环境

    https://sourceforge.net/projects/opensourcefile/files/ Nginx是一款高性能的HTTP和反向代理服务器.Nginx在反向代理,Rewrite规则 ...

  6. shell脚本一键安装redis集群[最终版]

    直接上shell了. #!/bin/bash #---------------------------------------------------------------------------- ...

  7. shell脚本一键安装jdk

    直接上shell #!/bin/bash #offline jdk install ipath="/usr/local" installpath=$(cd `dirname $0` ...

  8. shell脚本一键安装redis集群

    简介: 明天再写,上脚本 #!/bin/bash #-------------------------------------------------------------------------- ...

  9. shell脚本一键安装redis

    支持识别离线包和联网安装,自动修改使用后台运行模式,离线安装的方法是,将离线包和脚本放在同一个文件夹, 它会先识别有没有离线包, 有离线包就先安装离线包, 没有离线包就安装进行判断机器是否能联网, 能 ...

随机推荐

  1. 【转】SQL Server 2012 配置AlwaysOn(三)

    转载自:http://www.cnblogs.com/lyhabc/p/4682986.html 从0开始搭建SQL Server AlwaysOn 第三篇(配置AlwaysOn) 第一篇http:/ ...

  2. setTimeout和setImmediate以及process.nextTick的区别

    在javascript中我们了解到了setTimeout和setInterVal函数事件队列(任务队列)的相关知识,除了setTimeout和setInterval这两个方法外,Node.js还提供了 ...

  3. JAXB - Hello World

    We'll stick with the tradition and use a sort of "Hello World" XML document to illustrate ...

  4. 关于IO的一些数字

    http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/people ...

  5. SQL Server调优系列进阶篇 - 深入剖析统计信息

    前言 经过前几篇的分析,其实大体已经初窥到SQL Server统计信息的重要性了,所以本篇就要祭出这个神器了. 该篇内容会很长,坐好板凳,瓜子零食之类... 不废话,进正题 技术准备 数据库版本为SQ ...

  6. 使用repeater控件显示列表替代treeview

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  7. ###Markdown初步学习

    Markdown学习/* GitHub stylesheet for MarkdownPad (http://markdownpad.com) *//* Author: Nicolas Hery - ...

  8. 关于Masonry框架(AutoLayout)的用法--面向初学者

    Masonry作为目前较为流行的自动布局第三方框架,简单易用,大大减少了程序员花在UI布局和屏幕适配的精力与时间. 1 基本用法 1.1 事例1: 图1-1 // 首先是view1自动布局 [view ...

  9. InstallShield 版本转换

    InstallShield : 如何用低版本 打开高版本的工程   InstallShield 每个版本都有对应的版本号SchemaVersion,如下所示   InstallShield Versi ...

  10. the evaluation period for visual studio trial edition has ended的解决方法-转发

    首先献上自己收集的Visual studio 2008序列号: Visual Studio 2008 Professional Edition: XMQ2Y-4T3V6-XJ48Y-D3K2V-6C4 ...