VSFTP chroot 的問題 [論壇 - 伺服器架設]
正在瀏覽:
1 名遊客
VSFTP chroot 的問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員一級
![]() ![]() 註冊日期:
2009/11/30 15:09 所屬群組:
已註冊使用者 等級: 1
HP : 0 / 18
![]() |
我最近在學架FTP伺服器
每次我用 FileZilla 連線的時候都會出現這一行 500 OOPS: vsftpd: refusing to run with writable root inside chroot() 後來我去Google了一下 發現新的 VSFTP chroot後家目錄要設為唯讀 可是這樣就沒有辦法上傳檔案了 請問一下有人有解決的辦法嗎
2012/6/12 10:24
|
||||||||||
![]() |
回覆: VSFTP chroot 的問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() 註冊日期:
2009/12/6 10:32 所屬群組:
已註冊使用者 等級: 71
HP : 1404 / 1756
![]() |
2012/6/12 11:27
|
||||||||||
![]() |
回覆: VSFTP chroot 的問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員一級
![]() ![]() 註冊日期:
2009/11/30 15:09 所屬群組:
已註冊使用者 等級: 1
HP : 0 / 18
![]() |
是因為新的VSFTP限制 chroot 的時候家目錄必須為唯讀
我想請問一下如何取消這個限制
2012/6/12 11:31
|
||||||||||
![]() |
回覆: VSFTP chroot 的問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() 註冊日期:
2009/12/6 10:32 所屬群組:
已註冊使用者 等級: 71
HP : 1404 / 1756
![]() |
是因為新的VSFTP限制 chroot 的時候家目錄必須為唯讀 你在哪裏看到這個說法 你是指用 無名氏 登入嗎 把這個參數選項 改爲 NO anon_world_readable_only 無名氏 登入 也可以寫入 但是這樣是需要 安全上的考慮
2012/6/12 11:32
|
||||||||||
![]() |
回覆: VSFTP chroot 的問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員一級
![]() ![]() 註冊日期:
2009/11/30 15:09 所屬群組:
已註冊使用者 等級: 1
HP : 0 / 18
![]() |
2012/6/12 11:35
|
||||||||||
![]() |
回覆: VSFTP chroot 的問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() 註冊日期:
2009/12/6 10:32 所屬群組:
已註冊使用者 等級: 71
HP : 1404 / 1756
![]() |
我找不到他說的那個套件 你是指 /etc/vsftpd.conf 它在你安裝 vsftpd 時 就同步安裝在你的電腦裏 我在 #2 貼給你的 就是在 ubuntu 12.04 使用的方法 還有 你在網路上看到的文章 要注意 1. 是否 適用於 ubuntu # 同樣是 Linux 但是 還分很多發行版本 2. 是否 適用於 ubuntu 你正使用中的版本 # 同樣是 ubuntu 每半年發行一個新的版本 3. 如果不是 是否需要 適度修正
2012/6/12 11:41
|
||||||||||
![]() |
回覆: VSFTP chroot 的問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員一級
![]() ![]() 註冊日期:
2009/11/30 15:09 所屬群組:
已註冊使用者 等級: 1
HP : 0 / 18
![]() |
poloshiao 寫到: 謝謝
2012/6/12 11:53
|
||||||||||
![]() |
回覆: VSFTP chroot 的問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
版主
![]() ![]() 註冊日期:
2008/7/14 0:03 來自 螢幕的另一端
所屬群組:
網站管理員 已註冊使用者 討論區管理群 等級: 32
HP : 0 / 798
![]() |
若你的 vsftpd 升級到 2.3.5 版本之後,你會遇到一個新的問題,登入後出現如下訊息
回應: 500 OOPS: vsftpd: refusing to run with writable root inside chroot() 這是新版的 vsftpd 又增加了安全性的設定了,它不允許你的根目錄的權限設定是可以寫入的 所以你必須把該使用者的家目錄,可寫入的權限拿掉才能正常的登入 chmod a-w /home/user 你說沒有寫入的權限,那別人怎麼上傳檔案呀? 你可以在它的家目錄底下再幫它建個目錄,有寫入的權限即可。 至於說怎麼拿掉這個限制,沒辦法,官方設計的就是這樣。
2012/6/12 19:50
|
||||||||||
![]() |
回覆: VSFTP chroot 的問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員二級
![]() ![]() 註冊日期:
2011/1/27 15:53 所屬群組:
已註冊使用者 等級: 6
HP : 0 / 148
![]() |
這個安全性的設定倒是還好,但就算是chroot_local_user是可以設定在家目錄裡的,但我若使用FileZila,協定用SFTP的話,根本就無法限定在家目錄裡,也就是說登入者是可以到/所有的資料夾的,這才是我最不好處理的
chroot_local_user chroot_list_enable chroot_list_file 這三個設定並不會限定哦,有人可以解決嗎?
2012/6/14 19:25
|
||||||||||
![]() |
回覆: VSFTP chroot 的問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() 註冊日期:
2009/12/6 10:32 所屬群組:
已註冊使用者 等級: 71
HP : 1404 / 1756
![]() |
我若使用FileZila,協定用SFTP的話 如果你使用 SFTP 那你一定要產生一個 public key 和 private key 還要把 public key 放到 sshd_config 指定的 authorized_keys 檔案中 在 authorized_keys 中的一個 public key 類似這樣 ssh-rsa AAAAB3Nza...中間省略..LiPk== user@example.net 你可以在 這個 ssh-rsa 前面 或 user@example.net 後面加上許多 參數 來限制 sftp 的登入者 登入前的條件 與 登入後的行動 比 chroot_local_user chroot_list_enable chroot_list_file 限定在家目錄 還嚴格 這些參數有 1. command="command" Specifies that the command is executed whenever this key is used for authentication. The command supplied by the user (if any) is ignored. The command is run on a pty if the client requests a pty; otherwise it is run without a tty. If an 8-bit clean chan- nel is required, one must not request a pty or should specify no-pty. A quote may be included in the command by quoting it with a backslash. This option might be useful to restrict cer- tain public keys to perform just a specific operation. An exam- ple might be a key that permits remote backups but nothing else. Note that the client may specify TCP and/or X11 forwarding unless they are explicitly prohibited. The command originally supplied by the client is available in the SSH_ORIGINAL_COMMAND environ- ment variable. Note that this option applies to shell, command or subsystem execution. 2. environment="NAME=value" Specifies that the string is to be added to the environment when logging in using this key. Environment variables set this way override other default environment values. Multiple options of this type are permitted. Environment processing is disabled by default and is controlled via the PermitUserEnvironment option. This option is automatically disabled if UseLogin is enabled. 3. from="pattern-list" Specifies that in addition to public key authentication, either the canonical name of the remote host or its IP address must be present in the comma-separated list of patterns. See PATTERNS in ssh_config(5) for more information on patterns. In addition to the wildcard matching that may be applied to host- names or addresses, a from stanza may match IP addresses using CIDR address/masklen notation. The purpose of this option is to optionally increase security: public key authentication by itself does not trust the network or name servers or anything (but the key); however, if somebody somehow steals the key, the key permits an intruder to log in from anywhere in the world. This additional option makes using a stolen key more difficult (name servers and/or routers would have to be compromised in addition to just the key). 4. no-user-rc Disables execution of ~/.ssh/rc. 5. no-X11-forwarding Forbids X11 forwarding when this key is used for authentication. Any X11 forward requests by the client will return an error. 6. permitopen="host:port" Limit local ``ssh -L'' port forwarding such that it may only con- nect to the specified host and port. IPv6 addresses can be spec- ified with an alternative syntax: host/port. Multiple permitopen options may be applied separated by commas. No pattern matching is performed on the specified hostnames, they must be literal domains or addresses. 7. tunnel="n" Force a tun(4) device on the server. Without this option, the next available device will be used if the client requests a tun- nel. 詳細說明與舉例 請參考 1. AUTHORIZED_KEYS FILE FORMAT # 這是 sshd 伺服器端 2. SSH_KNOWN_HOSTS FILE FORMAT # 這是 ssh 客戶端
2012/6/14 20:02
|
||||||||||
![]() |
您可以查看帖子.
您不可發帖.
您不可回覆.
您不可編輯自己的帖子.
您不可刪除自己的帖子.
您不可發起投票調查.
您不可在投票調查中投票.
您不可上傳附件.
您不可不經審核直接發帖.