Linux

ftp proftp

目次

基本的なこと

ユーザー追加

  • ftpasswd --file /etc/ftpd.passwd --passwd --name hogehoge --uid 500 -gid 105 --home (共有fullpath) --shell /bin/bash

ユーザー削除

  • ftpasswd --file /etc/ftpd.passwd --passwd -delete-user --name USERNAME --uid 500 -gid 100 --home /home/USERNAME --shell /bin/sh

PASV mode 設定

  • NATルータ越えで、PASVモードを使用する場合
    または、「"PASV" 227 -」 のエラーが出る場合
  • sudo vi /etc/proftpd.conf
  • 下記を追加
    MasqueradeAddress         servername.tar3.net
    PassivePorts              4000 4029

設定,conf

  • sudo vi /etc/proftpd.conf

基本設定

ServerName                      "FTP server name"
ServerType                      standalone
ServerIdent                     on "FTP Server ready."
ServerAdmin                     hogehoge@hoge.com
DefaultServer                   on

default root

  • 書式「DefaultRoot? path名 ユーザー名(グループ名)」
  • ! は not の意味
    DefaultRoot                     /var/www/html hogeGroupName
    DefaultRoot                     /var/www/ !hogeGroupName

User, Group

  • default のまま
    User                            nobody
    Group                           nobody

MaxInstances?

  • 適当に設定
    MaxInstances                    20

SyslogLevel?

  • お好みで  SyslogLevel? info

MaxLoginAttempts?

  • 何回までログイン失敗を許すか
    MaxLoginAttempts 5

umask, AllowOverwrite?

  • お好みで
     Umask                         002
 # Allow users to overwrite files and change permissions
 AllowOverwrite                yes
 <Limit ALL SITE_CHMOD>
   AllowAll
 </Limit>

ldap 連携

ldap module のインストール

sudo yum install proftpd-ldap

/etc/proftpd.conf の編集

  • コメントを取る
    • before
      #LoadModule mod_ldap.c
    • after
      LoadModule mod_ldap.c
  • ldap関連の設定
    LDAPServer                      123.456.789.123:389
    LDAPAuthBinds                   on
    LDAPBindDN                      "cn=administrator,dc=hogehoge,dc=net" "password"
    LDAPUsers  "dc=hogehoge,dc=net" "(uid=%u)"
    LDAPGroups  "dc=hogehoge,dc=net" "(&(gidNumber=%v)(status=valid))"
    LDAPSearchScope subtree

Trouble関連

ファイルをアップロードできない。

  • ローカルのファイルを右クリック、「アップロード」を選択するとアップロードできた。(Drag and Dropではできなかった)

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-01-21 (土) 09:54:05 (458d)