FileZilla melaporkan 'Izin ditolak' tetapi mengosongkan file (menghapus semua konten file)


1

Masalah ini imo sangat aneh. Saya mendapat akses FTP ke situs yang sedang saya kerjakan, tetapi sepertinya ada masalah izin. Di FileZilla Jika saya mencoba Mengedit dan mengunggah kembali file ke server, saya mendapatkan Permission deniedkesalahan, tetapi pada saat yang sama konten file yang diedit terhapus di server! Jadi saya berakhir dalam situasi di mana file jarak jauh rusak (semua konten dihapus - 0B!), Tapi saya tidak punya izin untuk memperbaikinya.

Sebagian besar izin diatur ke 775 untuk folder dan 664 untuk file.

  • Mengapa saya bisa mendapatkan permission deniedkesalahan? Apa yang salah dengan izin saya?
  • Jika saya benar-benar tidak diberikan izin untuk menulis ke file, mengapa kontennya dihapus?

Saya melampirkan dua log FileZilla di sini, satu dengan debugging off:

10:32:02    Status: Connecting to [IP.ADD.RE.SS:PORT]...
10:32:05    Status: Connected to [IP.ADD.RE.SS]
10:32:05    Status: Retrieving directory listing...
10:32:05    Status: Listing directory /
10:32:06    Status: Directory listing of "/" successful
10:32:12    Status: Connecting to [IP.ADD.RE.SS:PORT]...
10:32:14    Status: Connected to [IP.ADD.RE.SS]
10:32:15    Status: Starting download of /wp-config.php
10:32:15    Status: remote:/wp-config.php => local:/tmp/fz3temp-1/wp-config.php
10:32:16    Status: File transfer successful, transferred 3.4 KB in 1 second
10:32:29    Status: Starting upload of /tmp/fz3temp-1/wp-config.php
10:32:30    Command:    put "/tmp/fz3temp-1/wp-config.php" "wp-config.php"
10:32:30    Error:  /wp-config.php: open for write: permission denied
10:32:30    Error:  File transfer failed
10:32:30    Status: Starting upload of /tmp/fz3temp-1/wp-config.php
10:32:30    Status: Retrieving directory listing of "/"...
10:32:30    Status: Listing directory /
10:32:39    Status: Skipping upload of /tmp/fz3temp-1/wp-config.php
10:32:39    Status: File transfer skipped
10:33:39    Status: Disconnected from server

Dan lainnya dengan debugging aktif

10:46:32    Status: Connecting to [IP.ADD.RE.SS:PORT]...
10:46:32    Trace:  Going to execute /usr/bin/fzsftp
10:46:32    Response:   fzSftp started, protocol_version=6
10:46:32    Trace:  CSftpControlSocket::ConnectParseResponse(fzSftp started, protocol_version=6)
10:46:32    Trace:  CSftpControlSocket::SendNextCommand()
10:46:32    Trace:  CSftpControlSocket::ConnectSend()
10:46:32    Command:    open "gqwp@[IP.ADD.RE.SS]" [PORT]
10:46:32    Trace:  Server version: SSH-2.0-mod_sftp/0.9.7
10:46:32    Trace:  We believe remote version has SSH-2 RSA padding bug
10:46:32    Trace:  Using SSH protocol version 2
10:46:32    Trace:  Doing Diffie-Hellman group exchange
10:46:33    Trace:  Doing Diffie-Hellman key exchange with hash SHA-256
10:46:33    Trace:  Server also has ssh-dss host key, but we don't know it
10:46:33    Trace:  Host key fingerprint is:
10:46:33    Trace:  ssh-rsa 2048 [LO:NG:SSH:FI:NG:ER:PR:INT]
10:46:33    Trace:  Initialised AES-256 SDCTR client->server encryption
10:46:33    Trace:  Initialised HMAC-SHA1 client->server MAC algorithm
10:46:33    Trace:  Initialised AES-256 SDCTR server->client encryption
10:46:33    Trace:  Initialised HMAC-SHA1 server->client MAC algorithm
10:46:33    Trace:  Pageant is running. Requesting keys.
10:46:34    Trace:  Pageant has 1 SSH-2 keys
10:46:34    Trace:  Attempting keyboard-interactive authentication
10:46:34    Trace:  Using keyboard-interactive authentication. inst_len: 0, num_prompts: 1
10:46:34    Command:    Pass: **************
10:46:34    Trace:  Access granted
10:46:34    Trace:  Opening session as main channel
10:46:34    Trace:  Opened main channel
10:46:34    Trace:  Started a shell/command
10:46:34    Status: Connected to [IP.ADD.RE.SS]
10:46:35    Trace:  CSftpControlSocket::ConnectParseResponse()
10:46:35    Trace:  CSftpControlSocket::ResetOperation(0)
10:46:35    Trace:  CControlSocket::ResetOperation(0)
10:46:35    Trace:  CFileZillaEnginePrivate::ResetOperation(0)
10:46:35    Trace:  CSftpControlSocket::FileTransfer(...)
10:46:35    Status: Starting upload of /tmp/fz3temp-1/wp-config.php
10:46:35    Trace:  CSftpControlSocket::SendNextCommand()
10:46:35    Trace:  CSftpControlSocket::ChangeDirSend()
10:46:35    Command:    cd "/"
10:46:35    Response:   New directory is: "/"
10:46:35    Trace:  CSftpControlSocket::ResetOperation(0)
10:46:35    Trace:  CControlSocket::ResetOperation(0)
10:46:35    Trace:  CSftpControlSocket::ParseSubcommandResult(0)
10:46:35    Trace:  CSftpControlSocket::FileTransferSubcommandResult()
10:46:35    Trace:  CSftpControlSocket::SendNextCommand()
10:46:35    Trace:  FileTransferSend()
10:46:35    Command:    put "/tmp/fz3temp-1/wp-config.php" "wp-config.php"
10:46:35    Error:  /wp-config.php: open for write: permission denied
10:46:35    Trace:  FileTransferParseResponse(2)
10:46:35    Trace:  CSftpControlSocket::ResetOperation(2)
10:46:35    Trace:  CControlSocket::ResetOperation(2)
10:46:35    Error:  File transfer failed
10:46:35    Trace:  CFileZillaEnginePrivate::ResetOperation(2)
10:46:35    Trace:  CSftpControlSocket::FileTransfer(...)
10:46:35    Status: Starting upload of /tmp/fz3temp-1/wp-config.php
10:46:35    Trace:  CSftpControlSocket::ParseSubcommandResult(0)
10:46:35    Trace:  CSftpControlSocket::FileTransferSubcommandResult()
10:46:35    Status: Retrieving directory listing of "/"...
10:46:36    Trace:  sftpcontrolsocket.cpp(836): List called from other command   caller=0x7f3db4003080
10:46:36    Trace:  CSftpControlSocket::ParseSubcommandResult(0)
10:46:36    Trace:  CSftpControlSocket::ListSubcommandResult()
10:46:36    Trace:    state = 1
10:46:36    Trace:  CSftpControlSocket::SendNextCommand()
10:46:36    Trace:  CSftpControlSocket::ListSend()
10:46:36    Trace:    state = 3
10:46:36    Command:    ls
10:46:36    Status: Listing directory /
10:46:37    Trace:  CSftpControlSocket::ListParseResponse()
10:46:37    Trace:  CSftpControlSocket::ResetOperation(0)
10:46:37    Trace:  CControlSocket::ResetOperation(0)
10:46:37    Trace:  CSftpControlSocket::ParseSubcommandResult(0)
10:46:37    Trace:  CSftpControlSocket::FileTransferSubcommandResult()
10:46:41    Trace:  CSftpControlSocket::SendNextCommand()
10:46:41    Trace:  FileTransferSend()
10:46:41    Command:    put "/tmp/fz3temp-1/wp-config.php" "wp-config.php"
10:46:41    Error:  /wp-config.php: open for write: permission denied
10:46:41    Trace:  FileTransferParseResponse(2)
10:46:41    Trace:  CSftpControlSocket::ResetOperation(2)
10:46:41    Trace:  CControlSocket::ResetOperation(2)
10:46:41    Error:  File transfer failed
10:46:41    Trace:  CFileZillaEnginePrivate::ResetOperation(2)
10:46:41    Trace:  CSftpControlSocket::FileTransfer(...)
10:46:41    Status: Starting upload of /tmp/fz3temp-1/wp-config.php
10:46:41    Trace:  CSftpControlSocket::ParseSubcommandResult(0)
10:46:41    Trace:  CSftpControlSocket::FileTransferSubcommandResult()
10:46:41    Status: Retrieving directory listing of "/"...
10:46:41    Trace:  sftpcontrolsocket.cpp(836): List called from other command   caller=0x7f3db4003080
10:46:41    Trace:  CSftpControlSocket::ParseSubcommandResult(0)
10:46:41    Trace:  CSftpControlSocket::ListSubcommandResult()
10:46:41    Trace:    state = 1
10:46:41    Trace:  CSftpControlSocket::SendNextCommand()
10:46:41    Trace:  CSftpControlSocket::ListSend()
10:46:41    Trace:    state = 3
10:46:41    Command:    ls
10:46:41    Status: Listing directory /
10:46:42    Trace:  CSftpControlSocket::ListParseResponse()
10:46:42    Trace:  CSftpControlSocket::ResetOperation(0)
10:46:42    Trace:  CControlSocket::ResetOperation(0)
10:46:42    Trace:  CSftpControlSocket::ParseSubcommandResult(0)
10:46:42    Trace:  CSftpControlSocket::FileTransferSubcommandResult()
10:46:42    Trace:  CSftpControlSocket::SendNextCommand()
10:46:42    Trace:  FileTransferSend()
10:46:42    Command:    put "/tmp/fz3temp-1/wp-config.php" "wp-config.php"
10:46:42    Error:  /wp-config.php: open for write: permission denied
10:46:42    Trace:  FileTransferParseResponse(2)
10:46:42    Trace:  CSftpControlSocket::ResetOperation(2)
10:46:42    Trace:  CControlSocket::ResetOperation(2)
10:46:42    Error:  File transfer failed
10:46:42    Trace:  CFileZillaEnginePrivate::ResetOperation(2)
10:46:42    Status: Retrieving directory listing of "/"...
10:46:42    Trace:  CSftpControlSocket::ParseSubcommandResult(0)
10:46:42    Trace:  CSftpControlSocket::ListSubcommandResult()
10:46:42    Trace:    state = 1
10:46:42    Trace:  CSftpControlSocket::SendNextCommand()
10:46:42    Trace:  CSftpControlSocket::ListSend()
10:46:42    Trace:    state = 3
10:46:42    Command:    ls
10:46:43    Status: Listing directory /
10:46:43    Trace:  CSftpControlSocket::ListParseResponse()
10:46:43    Trace:  CSftpControlSocket::ResetOperation(0)
10:46:43    Trace:  CControlSocket::ResetOperation(0)
10:46:43    Status: Directory listing of "/" successful
10:46:43    Trace:  CFileZillaEnginePrivate::ResetOperation(0)

Dan tentu saja jangan katakan "FTP", ketika itu "SFTP".
Martin Prikryl

Bisakah Anda mencoba yang sama dengan WinSCP? Belum detail logging.
Martin Prikryl

Martin saya di Linux, dan sepertinya WinSCP tidak tersedia untuk OS saya. Apakah Anda pikir ada alternatif untuk saya?
Томица Кораћ

Setidaknya coba klien SFTP yang berbeda (misal, baris perintah OpenSSH sftp) untuk memeriksa apakah Anda mendapatkan perilaku yang sama.
Martin Prikryl

Jawaban:


2

Memeriksa kode sumber FileZilla / Putty, jelas bahwa FileZilla memang menerima kesalahan "izin ditolak" ketika mencoba membuka file untuk ditulis.

Jika konten file dihapus meskipun ada kesalahan, itu harus merupakan bug / kesalahan konfigurasi server SFTP.


Martin terima kasih banyak atas semua kesabaran Anda. Saya akan mengatakan ini kepada pemilik untuk melihat apa yang dia pikirkan.
Томица Кораћ

Martin, ternyata saya diberikan kredensial login yang salah untuk server. Secara khusus, saya diberitahu bahwa saya harus menggunakan SFTP, tetapi itu adalah FTP, jadi saya punya port # dan protokol yang salah. Ini menyebabkan semua keributan. Segera setelah pemilik situs memberikan kredensial yang benar, semuanya tampak baik-baik saja, meskipun sedikit lebih lambat. Tentu saja, saya benar-benar memilih jawaban Anda, dan sekarang setelah kami menyelesaikannya, saya akan menerimanya juga. Tepuk tangan!
Томица Кораћ
Dengan menggunakan situs kami, Anda mengakui telah membaca dan memahami Kebijakan Cookie dan Kebijakan Privasi kami.
Licensed under cc by-sa 3.0 with attribution required.