|
<
近来正在设置百度云效劳器战阿里云效劳器,需求把本地的代码战材料上传到效劳器,运转测试。
因而便需求本人拆建一个FTP效劳。
ftp效劳器装置取设置
假如之前设置过ftp效劳器的仍是以后设置的效劳器,没法启动效劳,那末底子是设置呈现了毛病,那末可先完整卸载后再停止装置。假如没法定位多数是镜像源的成绩,请改换阿里源。
- sudo apt-get update
- sudo apt-get install vsftpd
- vsftpd --version //检测能否装置
复造代码- vim /etc/vsftpd.conf //编纂设置文件
复造代码 修正vsftpd.conf文件以下:
- listen=NO //能否开启监听ipv4战ipv6数据
- listen_ipv6=YES //能否开启监听ipv6数据
- # Allow anonymous FTP? (Disabled by default).
- anonymous_enable=NO //能否许可藏名登岸,无需暗码
- # Uncomment this to allow local users to log in.
- local_enable=YES //能否许可当地用户登录
- # Uncomment this to enable any form of FTP write command.
- write_enable=YES //能否许可登岸者上传文件
- # Default umask for local users is 077. You may wish to change this to 022,
- # if your users expect that (022 is used by most other ftpd's)
- local_umask=022 //设置当地用户默许要加免的权限
- # Activate directory messages - messages given to remote users when they
- # go into a certain directory.
- dirmessage_enable=YES //目次动静,可以给长途登岸的用户收收目次
- #
- # If enabled, vsftpd will display directory listings with the time
- # in your local time zone. The default is to display GMT. The
- # times returned by the MDTM FTP command are also affected by this
- # option.
- use_localtime=YES //效劳器所展现的目次将跟着当地工夫而改动
- #
- # Activate logging of uploads/downloads.
- xferlog_enable=YES //开启上传下载的日记记载
- #
- # Make sure PORT transfer connections originate from port 20 (ftp-data).
- connect_from_port_20=YES //确认毗连传输的端标语为20
- # You may override where the log file goes if you like. The default is shown
- # below.
- xferlog_file=/var/log/vsftpd.log //日记文件寄存地位
- #
- # If you want, you can have your log file in standard ftpd xferlog format.
- # Note that the default log file location is /var/log/xferlog in this case.
- xferlog_std_format=YES //日记文件接纳尺度格局
- # You may fully customise the login banner string:
- ftpd_banner=Welcome to FTP service. //正在利用shell时登岸那末会收收欢送语
- # You may specify an explicit list of local users to chroot() to their home
- # directory. If chroot_local_user is YES, then this list becomes a list of
- # users to NOT chroot().
- # (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
- # the user does not have write access to the top level directory within the
- # chroot)
- chroot_local_user=YES //对当地用户能否施行限定
- chroot_list_enable=YES //开启限定利剑名单
- # (default follows)
- chroot_list_file=/etc/vsftpd.chroot_list //利剑名单途径,若无那个文件需求本人创立
- # This option should be the name of a directory which is empty. Also, the
- # directory should not be writable by the ftp user. This directory is used
- # as a secure chroot() jail at times vsftpd does not require filesystem
- # access.
- secure_chroot_dir=/var/run/vsftpd/empty
- #
- # This string is the name of the PAM service vsftpd will use.
- # pam_service_name=vsftpd
- pam_service_name=ftp //此处ubuntu的体系需求改成ftp
- # This option specifies the location of the RSA certificate to use for SSL
- # encrypted connections.
- rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
- rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
- ssl_enable=NO
- #
- # Uncomment this to indicate that vsftpd use a utf8 filesystem.
- utf8_filesystem=YES //编码同一为utf8编码,能够辨认中文,避免治码
复造代码 增加设置ftpuser用户战会见目次
- sudo groupadd ftpusers //创立ftpusers用户组
- sudo useradd -m ftpuser_lxr//创立一个用户而且主动创立家目次为/home/ftpuser_lxr
- (第两种方法:mkdir /home/ftpuser_lxr //先创立家目次sudo userad -d /home/ftpuser_lxr ftpuser_lxr //绑定那个家目次)
- usermod -G ftpusers ftpuser_lxr //将那个新用户参加到ftpusers用户组中
- sudo passwd ftpuser_lxr //变动暗码
- mkdir /home/ftpuser_lxr/ftp //为用户增加一个具有必然权限的文件夹
- chmod 777 -R /home/ftpuser_lxr/ftp //新建一个pub目次用于寄存文件,而且付与局部权限
- usermod -s /sbin/nologin username //限定用户登录方法;限定用户username只能经由过程ftp登岸,而不克不及间接登岸效劳器
复造代码- 2.将该用户参加vsftpd.chroot_list利剑名单中
复造代码- mkdir /etc/vsftpd.chroot_list
- vim vsftpd.chroot_list
复造代码 该文件内乱容以下:
systemctl start vsftpd大概service vsftpd start
systemctl restart vsftpd大概service vsftpd restart
测试
办法一:
- 翻开阅读器,正在地点栏输进:ftp://ip_addresss
复造代码 办法两:
- 正在ubuntu中利用shell输进:ftp ip_address
复造代码 办法三:
- 正在windows中正在文件办理器地点栏输进:ftp://ip_addresss,该方法能够上传下载文件
复造代码 办法四:
- 正在windows中利用cmd输进:ftp://ip_addresss //显现毗连胜利
复造代码
免责声明:假如进犯了您的权益,请联络站少,我们会实时删除侵权内乱容,感谢协作! |
1、本网站属于个人的非赢利性网站,转载的文章遵循原作者的版权声明,如果原文没有版权声明,按照目前互联网开放的原则,我们将在不通知作者的情况下,转载文章;如果原文明确注明“禁止转载”,我们一定不会转载。如果我们转载的文章不符合作者的版权声明或者作者不想让我们转载您的文章的话,请您发送邮箱:Cdnjson@163.com提供相关证明,我们将积极配合您!
2、本网站转载文章仅为传播更多信息之目的,凡在本网站出现的信息,均仅供参考。本网站将尽力确保所提供信息的准确性及可靠性,但不保证信息的正确性和完整性,且不对因信息的不正确或遗漏导致的任何损失或损害承担责任。
3、任何透过本网站网页而链接及得到的资讯、产品及服务,本网站概不负责,亦不负任何法律责任。
4、本网站所刊发、转载的文章,其版权均归原作者所有,如其他媒体、网站或个人从本网下载使用,请在转载有关文章时务必尊重该文章的著作权,保留本网注明的“稿件来源”,并自负版权等法律责任。
|