美文网首页学ubuntuUbuntu学步者我用 Linux
使用sftp在Ubuntu server上搭建ftp教程

使用sftp在Ubuntu server上搭建ftp教程

作者: 松山剑客 | 来源:发表于2018-03-17 18:22 被阅读24次

    Environment Setup

    1. Install Ubuntu Server

    2. Connect your server to your router, and set up the internet

    sudo ifconfig eth0 up
    sudo dhclient eth0
    # the 'eth0' part should be the same with you own hardware as shown in the output of ifconfig
    

    3. Prepare the folder and account for FTP

    3.1 Creat an account for FTP user

    sudo useradd hitcsc
    sudo passwd hitcsc
    #Enter the password twice
    

    3.2 Creat a folder or FTP users

    In /home

    mkdir ftp
    sudo chown hitcsc:hitcsc ftp
    

    Use ls -l to test if the owner of ftp is set as hitcsc

    Install and set up VSFTP

    1. Install

    sudo apt-get update
    

    then

    sudo apt-get install vsftp
    

    2. FTP Set Up

    Edit the configure file of VSFTP

    sudo vi /etc/vsftpd.conf
    

    Edit the file like this

    listen=YES               #以standalone模式运行vsftpd
    #listen_ipv6=YES
    anonymous_enable=NO #允许匿名用户访问
    local_enable=YES
    write_enable=YES
    virtual_use_local_privs=YES
    #local_umask=022
    #anon_upload_enable=YES
    #anon_mkdir_write_enable=YES
    dirmessage_enable=YES    #当用户首次进入FTP服务器的目录时,显示该目录下的message消息,默认为.message文件,可以用message_file来定义
    xferlog_enable=YES #启用日志,默认路径/var/log/vsftpd.log
    connect_from_port_20=YES #数据连接使用默认的ftp-data端口(20端口)
    use_localtime=YES
    ssl_enable=NO
    local_root=/home/ftp
    cmds_denied=DELE,RMD #禁止删除
    

    Use sudo service svftpd start to start the service

    相关文章

      网友评论

        本文标题:使用sftp在Ubuntu server上搭建ftp教程

        本文链接:https://www.haomeiwen.com/subject/wdwjqftx.html