我想配置一SFTP服務器的CentOS 6.但是當我用「放」與Filezila客戶,我有這樣的消息:獲取CentOS中
open for write: permission denied
在我的日誌SFTP我有這樣的,當我用「把」:
...
unsupported '[email protected]' channel requested, ignoring
'subsystem' channel request for 'sftp' subsystem
..
error checking 'namefile' for REALPATH : Aucun fichier ou dossier de ce type
error opening 'filename'; Permission non accordée
我沒有,因爲在Debian上它工作得很好理解......
安裝proftpd的:
sudo rpm –Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo yum install proftpd
對於我的測試,我阻止防火牆:
service iptables stop
我評論在ssh配置文件中的行 「子系統」 「的sshd_config」
# Subsystem sftp ....
我加入proftpd的配置文件,該行「proftpd.conf」:
nano /etc/proftpd.conf
LoadModule mod_sftp.c
LoadModule mod_sftp_pam.c
<IfModule mod_sftp.c>
# On écoute sur le port 2222
Port 2222
# On active le mode SFTP
SFTPEngine on
# Emplacement des clés de cryptage
SFTPHostKey /etc/ssh/ssh_host_rsa_key2
SFTPHostKey /etc/ssh/ssh_host_dsa_key2
# Pour le moment, on met authentification par mot de passé
# On changera après par authentification par clé
SFTPAuthMethods password
# L’utilisateur est bloqué au repertoire qu’on lui a attribué
lors de sa création
DefaultRoot ~
# On ajoute les fichiers log pour le sftp
SFTPLog /etc/sftp/log/sftp.log
TransferLog /etc/sftp/log/sftp-transfer.log
</IfModule>
我添加了一個新用戶和新組:
groupadd upload
adduser --home /etc/sftp/home nom_utilisateur
# On associe le nouvel utilisateur à un des groupes (upload ou download)
usermod –g nom_groupe nom_utilisateur
我可以連接到SFTP(日誌文件罷了),但是當我在一個服務器上創建一個文件「測試」,在filezila文件我不能使用「放」 ..被重命名「艾薇28 12 :45考」 ..
文件權限/ home是777
這是本proftpd.conf中:發現
# This is the ProFTPD configuration file
ServerName "ProFTPD server"
ServerIdent on "FTP Server ready."
ServerAdmin [email protected]
DefaultServer on
VRootEngine on
VRootAlias /etc/security/pam_env.conf etc/security/pam_env.conf
# Use pam to authenticate (default) and be authoritative
AuthPAMConfig proftpd
AuthOrder mod_auth_pam.c* mod_auth_unix.c
# If you use NIS/YP/LDAP you may need to disable PersistentPasswd
PersistentPasswd off
# Don't do reverse DNS lookups (hangs on DNS problems)
UseReverseDNS off
# Set the user and group that the server runs as
User nobody
Group nobody
# Disable sendfile by default since it breaks displaying the download speeds in
# ftptop and ftpwho
UseSendfile on
# Define the log formats
LogFormat default "%h %l %u %t \"%r\" %s %b"
LogFormat auth "%v [%P] %h %t \"%r\" %s"
LoadModule mod_sftp.c
LoadModule mod_sftp_pam.c
# Dynamic ban lists (http://www.proftpd.org/docs/contrib/mod_ban.html)
# Enable this with PROFTPD_OPTIONS=-DDYNAMIC_BAN_LISTS in /etc/sysconfig/proftpd
<IfDefine DYNAMIC_BAN_LISTS>
LoadModule mod_ban.c
BanEngine on
BanLog /var/log/proftpd/ban.log
BanTable /var/run/proftpd/ban.tab
BanOnEvent MaxLoginAttempts 2/00:10:00 01:00:00
BanControlsACLs all allow user ftpadm
</IfDefine>
<Global>
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable
Umask 022
# Allow users to overwrite files and change permissions
AllowOverwrite on
<Limit ALL SITE_CHMOD>
AllowAll
</Limit>
</Global>
## SFTP
....
我試着用虛擬用戶,但它仍然無法正常工作.. – user3581358