AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-405229

Raul Chiarella's questions

Martin Hope
Raul Chiarella
Asked: 2023-07-01 03:09:44 +0800 CST

纯 FTP 服务器让我从“Bind Mounted HTML”文件夹下载文件,但在上传 Index.html 时会向 STOR 命令抛出 533 错误

  • 6

昨天我使用 Pure-FTPd 完成了 FTP 服务器的配置。我使用的方法是“虚拟用户”方法。

下面的命令基本上是我为了使其工作而执行的命令:

PureFTPd (Debian 10)

Instalar FTP usando o Pure-FTPd no Debian 10:

sudo apt install -y pure-ftpd-common pure-ftpd # Install Pure-FTPd
sudo ss -lnpt | grep pure-ftpd # Check what port is Pure-FTPd is running

Initial Steps for Preparing Pure-FTPd to work:

System User and Group:

sudo su -
groupadd ftpgroup  # Create FTP Group
useradd -g ftpgroup -d /dev/null -s /etc ftpuser  # Create Emulated System User for Virtual FTP User
mkdir /home/ftpusers  # Create Base Home dir for Virtual Users

chown root:root /home/ftpusers -R  # Set root Permissions so Pure-FTPd can create folders Automatically
chgrp ftpgroup /home/ftpusers  # Set permissions to FTP Group for Virtual Users Permissions
chmod g+rx /home/ftpusers

PureFTPd Config


echo "yes" > /etc/pure-ftpd/conf/Daemonize  # Run as Daemon
echo "yes" > /etc/pure-ftpd/conf/NoAnonymous  # Prohibit Anonymous
echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone  # Enable chroot
echo “yes” > /etc/pure-ftpd/conf/VerboseLog  # Enable Verbose Logging
echo yes > /etc/pure-ftpd/conf/CreateHomeDir  # Create Folders Automatically
echo no > /etc/pure-ftpd/conf/PAMAuthentication  # ??? Check Later
echo no > /etc/pure-ftpd/conf/UnixAuthentication  # ??? Check Later - Disable login, maybe?

>/var/log/pure-ftpd/transfer.log && chmod 755 /var/log/pure-ftpd/transfer.log  # Enable Logging

Config. Pure-FTPd => /etc/pure-ftpd/pure-ftpd.conf

# This limits accounts to only what is in the Pure-FTPd database
AUTH="-lpuredb:/etc/pure-ftpd/pureftpd.pdb"

# Disallow anonymous connections. Only accept authenticated users.
NoAnonymous                  yes

# File creation mask. <umask for files>:<umask for dirs> - Use 177:077 if you’re paranoid.
Umask                        003:002

# Enable Passive mode to avoid Firewall NAT problems.
PassivePortRange 40000 60000

Config. Common Pure-FTPd => vi /etc/default/pure-ftpd-common

id -u ftpuser # Get UID/GID of FTP User first.
Change UPLOADUID/UPLOADGID on pure-ftpd-common file.

Those commands are needed for some reason, otherwise, user can’t login:
ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/40PureDB
ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/50pure

Virtual User PureFTPd

pure-pw useradd victor -u ftpuser -g ftpgroup -d /home/ftpusers/victor
pure-pw passwd victor -m

Reload PureFTPd
pure-pw mkdb -f /etc/pure-ftpd/pureftpd.passwd -F /etc/pure-ftpd/pureftpd.pdb  # Update PureFTPd Database
service pure-ftpd restart

但是,在此之后,我的下一个需求是从 NGINX 安装中创建一个 HTML 文件夹,供客户端通过 FTP 传输文件。按照上面的命令,以及他的 Chrooted FTP 文件夹 - 一切正常!如果我尝试使用 MobaXTerm 或其他 FTP 客户端将任何内容上传到他的 FTP 文件夹,我可以做到。

但是,如果我尝试将其上传到我使用以下命令创建的 HTML 绑定文件夹,它不会让我这样做:

CHRoot HTML Folder

mkdir -p /home/ftpusers/victor/sites  # Create Websites Folder for Victor
mount --bind /var/www/html /home/ftpusers/victor/sites  # Bind Mount because Link command does not work

Config. for FSTab in order to mount it at boot:

/mnt/data/html /var/www/html none nofail,bind 0 0
/var/www/html /home/ftpusers/victor/sites none nofail,bind 0 0
groups www-data  # Check what groups NGINX user is in
chown -R :<group> /var/www/html  # Just to be sure let’s redo HTML Permission for NGINX.
chmod -R g+w /var/www/html  # Group can Edit/Write

usermod -a -G www-data ftpuser  # Add our FTP User to NGINX Group
groups ftpuser # Now FTP User is in the same groups as NGINX User

Read and Write tests for FTP using cURL => All Tests worked when the owners were ftpuser  ftpgroup.

When Owners were www-data www-data it does not let my FTP User replace and upload files... Even tho, I added the FTP User above as being in the group that is owning the files.

curl ftp://localhost:21/testfile_read -u 'victor:ftp_password' -O  # Read Permissions from Outside HTML folder
curl ftp://localhost:21/sites/testfile_html_read -u 'victor:ftp_password' -O  # Read Permissions from Inside HTML folder.

curl -T testfile_write ftp://localhost:21/ -u 'victor:ftp_password'  # Write Permissions from Outside HTML folder.
curl -T testfile_html_write ftp://localhost:21/sites/ -u 'victor:ftp_password' # Write Permissions from Inside HTML folder.

权限 MobaXTerm 的权限

所以,看起来这是 www-data 和绑定文件夹本身的权限问题...但它没有意义,因为我将 FTP 用户添加到已经可以编辑/写入的组中...?

我快疯了,请问有人可以帮助我吗?

TL;DR:我需要帮助,允许 FTP 用户读取和写入其 chroot FTP 文件夹中的绑定 HTML 文件夹。目前,即使我将 FTP 用户添加到 www-data 组,我在尝试将文件上传到绑定的 HTML 文件夹时仍收到 553 错误(权限被拒绝)。

总之,我想为 FTP 用户提供访问和修改绑定的 HTML 文件夹所需的权限。尽管将用户添加到 www-data 组,但在尝试将文件上传到该文件夹​​时遇到 553 错误。任何帮助将不胜感激。

ftp
  • 1 个回答
  • 17 Views
Martin Hope
Raul Chiarella
Asked: 2022-04-14 13:33:28 +0800 CST

仅当存在 Samba 挂载时才绑定挂载?(例如:BIND MOUNT 需要 NFS 挂载 \\172.16.xx\files...)

  • 1

我在 fstab 中使用以下内容安装了 SAMBA:

//source/files /mnt/files cifs user,_netdev,cache=none,credentials=/usr/src/access.smb 0 0

然后我有以下 mount --bind 行:

/mnt/files /var/www/html/data none defaults,bind 0 0

但是第二个挂载不起作用。如果我重新启动计算机,则只有第一个挂载有效。我需要手动安装第二个(使用绑定)

请问,有人可以帮我吗?我在 Unix Stack Exchange 上看到了这篇文章,但我不明白:https ://unix.stackexchange.com/questions/216287/how-do-i-set-up-bind-mounts-on-startup-correctly-in -系统世界

提前致谢。

linux nfs mount samba bind
  • 1 个回答
  • 93 Views
Martin Hope
Raul Chiarella
Asked: 2022-04-06 07:03:04 +0800 CST

如何使用 SmartCTL 从 RAID 获取硬盘状态以进行监控?

  • 1

我有一个运行 3 个硬盘的 RAID 的 FreeBSD。我面临监控其 RAID 的挑战 - 如果硬盘出现故障或出现一些我需要知道的问题。

所以,我现在做的第一件事是尝试了解 SmartCTL 的工作原理……我目前使用的命令是:

smartctl --scan -j - To scan my devices and generated a JSON Structured list.
smartctl -i /dev/device_name - To list informations about a single device
smartctl -a /dev/your-device - More information like errors and etc (I think i can use this in some way to grep only errors sections...)

SmartCTL 是否还有其他参数可以检查磁盘是否可写、是否处于活动状态以及其健康状态是否正常?

这个理解的主要目的是主要使用 SmartCTL 来生成数据,这些数据将用于 pfSense RAID Monitoring with Low Level Discovery for Zabbix Monitoring Software 的模板中......

任何帮助都将不胜感激。

hard-drive monitoring freebsd pfsense zabbix
  • 1 个回答
  • 398 Views
Martin Hope
Raul Chiarella
Asked: 2022-02-05 07:43:39 +0800 CST

如何在 pfSense 上自动保存和强制更新动态 DNS?

  • 0

每次我的 pfSense 的 IP 地址更改时,我都需要手动登录面板,转到服务 > 动态 DNS > 操作 [编辑] > ♻ 保存并强制更新

请问,我如何使用 Cron 做到这一点?我已经安装了 Package 'Cron' 并执行了以下操作(基于 ServerFault 上的另一个问题 - 它不起作用。)

1 1 * * * 根 /usr/bin/nice -n20 /etc/rc.force.dyndns.update

rc.force.dyndns.update 中的代码是:

#!/bin/sh
rm /cf/conf/dyndns\_wancustom\\'\\'0.cache
/etc/rc.dyndns.update

那没起效。问题不断发生。

domain-name-system scheduled-task cron pfsense
  • 1 个回答
  • 358 Views
Martin Hope
Raul Chiarella
Asked: 2021-10-14 06:02:12 +0800 CST

访问 Apache 上的服务器状态时被禁止(403)[重复]

  • 0
这个问题在这里已经有了答案:
禁止(403),在访问 apache 2.2.22 上的服务器状态时 (3 个答案)
10 个月前关闭。

我正在尝试访问 Apache server-status?auto 但它给了我 Forbidden 403 消息

我检查了 apache2.conf 并且在 html 目录下有这个选项:

<Directory /var/www/html>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

有没有人遇到过这个问题并且能够解决它?提前致谢。如果您需要更多信息,请与我们联系...

PS:我已经尝试过 Shahar Galukman 提出的建议问题的解决方案,但那里的答案对我没有帮助,或者我不够聪明,无法理解。

谢谢你的耐心

apache-2.2 virtualhost http-status-code-403
  • 1 个回答
  • 653 Views
Martin Hope
Raul Chiarella
Asked: 2021-04-06 10:15:31 +0800 CST

CentOS 7 路由器/DHCP 服务器:插入第二个 NIC 适配器但不通过电缆发送互联网

  • 0

我有一个配置为路由器/dhcp 服务器的 CentOS 7 服务器其中安装了两个 NIC - 第一个从外部接收互联网,它应该正常工作。

第二个 NIC 配置为静态 IP,它应该作为路由器将 Internet 转发到连接在其中的笔记本电脑。

我通过 nmtui 配置了 dhcp.conf 和网络问题是互联网没有被转发到我的笔记本,所以它不工作。有人能帮我吗?

NMTUI 配置

DHCP 配置

linux networking configuration centos7
  • 1 个回答
  • 363 Views
Martin Hope
Raul Chiarella
Asked: 2019-09-13 07:03:05 +0800 CST

在 ProxMox 中从原始文件创建 VM

  • 0

我在 ProxMox 中创建了 VM 的快照并生成了 VM 的原始文件。我的那个 ProxMox 遇到了问题,我需要使用该原始文件在另一个 ProxMox 中创建一个 VM...

原始文件已经在我需要创建虚拟机的 ProxMox 的存储中,但我无法使用该原始文件创建虚拟机......

我尝试使用 RAW 格式磁盘映像创建一个新 VM,然后将我的原始文件复制到 ProxMox 创建的那个中,并像我在 ProxMox.com 上的一篇文章中看到的那样覆盖它,但它不起作用......在控制台显示“找不到启动设备”

我怎么做?

linux
  • 1 个回答
  • 858 Views
Martin Hope
Raul Chiarella
Asked: 2017-11-01 09:16:13 +0800 CST

Sendmail 和 Postdrop 淹没了我的服务器

  • 1

我没主意了。有人可以启发我吗?

ps -ef给我看。

/usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
/usr/sbin/postdrop -r

有谁知道这是什么原因?

linux
  • 2 个回答
  • 7015 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve