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-904676

justadev's questions

Martin Hope
justadev
Asked: 2019-05-01 03:20:09 +0800 CST

无法使用 vsftpd 登录虚拟用户

  • 1

我知道以前有人问过它(例如这里),但我完全被卡住了,不知道如何让它工作。

我正在尝试设置几个 ftp 用户,每个用户都有自己的子文件夹(因此用户只能看到他的根文件夹,而没有其他内容)。

当前的问题是在filezilla上我得到

Command:    open "[email protected]" 22
Command:    Trust new Hostkey: Once
Command:    Pass: ******
Error:  Authentication failed.
Error:  Critical error: Could not connect to server

/etc/vsftpd.conf

listen=YES
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
connect_from_port_20=YES
nopriv_user=vsftpd
virtual_use_local_privs=YES
guest_enable=YES
user_sub_token=$USER
local_root=/home/ftpmain/ftp/$USER
hide_ids=YES
guest_username=vsftpd
secure_chroot_dir=/var/run/vsftpd/empty
ssl_enable=YES
allow_anon_ssl=NO
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
require_ssl_reuse=NO
ssl_ciphers=HIGH
pasv_address=123.123.123.123
pasv_enable=Yes
pasv_min_port=40000
pasv_max_port=50000
chroot_local_user=YES
chroot_list_enable=NO

/etc/pam.d/vsftpd

auth required pam_pwdfile.so pwdfile /etc/vsftpd/ftpd.passwd
account required pam_permit.so

user1 文件夹如下所示(在 chmod+chown 之后):

/home/ftpmain/ftp/user1$ ll
total 12
dr-xr-xr-x 3 root   root    4096 Mar 18 19:17 ./
dr-xr-xr-x 4 nobody nogroup 4096 Mar 18 19:09 ../
drwxr-xr-x 2 vsftpd nogroup 4096 Mar 18 19:17 folder1/

网络统计

$ netstat -tlpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -

关于我缺少什么以及如何使其发挥作用的任何想法?有没有办法调试它?一些日志文件,我可以检查为什么登录失败?

任何帮助将不胜感激,如果您需要更多信息,请告诉我

PS:在 ubuntu 18.04 上运行

更新

我在 /var/log/auth 文件中发现了这个错误:

$ tail -f /var/log/*

Apr 30 15:05:49 ip-172-31-40-232 sshd[25641]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=111.111.111.111
Apr 30 15:05:51 ip-172-31-40-232 sshd[25641]: Failed password for invalid user user1 from 111.111.111.111 port 53251 ssh2
Apr 30 15:05:51 ip-172-31-40-232 sshd[25641]: error: Received disconnect from 111.111.111.111 port 53251:13: Unable to authenticate [preauth]
Apr 30 15:05:51 ip-172-31-40-232 sshd[25641]: Disconnected from invalid user user1 111.111.111.111 port 53251 [preauth]

我发现 vsftpd 根本没有运行!我以前没有看到它的原因是因为我有 SFTP 工作(使用端口 22)。vsftpd 状态为“失败”。

$ sudo /etc/init.d/vsftpd status
● vsftpd.service - vsftpd FTP server
   Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2019-04-30 15:45:56 UTC; 2s ago
  Process: 25980 ExecStart=/usr/sbin/vsftpd /etc/vsftpd.conf (code=exited, status=2)
  Process: 25972 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/SUCCESS)
 Main PID: 25980 (code=exited, status=2)

我从命令行手动运行 vsftpd 并发现存在证书错误

$ sudo /usr/sbin/vsftpd /etc/vsftpd.conf
500 OOPS: SSL: cannot load RSA certificate
vsftpd
  • 1 个回答
  • 2329 Views
Martin Hope
justadev
Asked: 2018-12-17 03:48:40 +0800 CST

将 /etc/network/interfaces 转换为 netplan 用于浮动 IP

  • 1

我是 Ubuntu 18.04 上的 netplan 的新手,今天才发现它存在。我有一个界面,我正在尝试添加以在谷歌云上创建一个浮动 IP。它基于此示例: https ://cloud.google.com/solutions/best-practices-floating-ip-addresses#implementing_option_4

我测试了这个例子,它可以工作,但现在我尝试在 ubuntu 上做同样的事情,我不知道如何转换它:

cat << EOF >> /etc/network/interfaces
auto eth0:0
iface eth0:0 inet static
    address 10.190.1.1
    netmask 255.255.255.255
EOF

到网络计划。

的输出ls /etc/netplan是“50-cloud-init.yaml”。的输出cat /etc/netplan/*.yaml是:

network:
    version: 2
    ethernets:
        ens4:
            dhcp4: true
            match:
                macaddress: 42:01:0a:8e:00:3e
            set-name: ens4

我的ifconfig:

# ifconfig  ens4
ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
    inet 10.142.0.62  netmask 255.255.255.255  broadcast 0.0.0.0
    inet6 fe80::4001:aff:fe8e:3e  prefixlen 64  scopeid 0x20<link>
    ether 42:01:0a:8e:00:3e  txqueuelen 1000  (Ethernet)
    RX packets 9430  bytes 1635180 (1.6 MB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 13383  bytes 1513428 (1.5 MB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

对于netplan,他所说的放入文件中的内容相当于什么?

networking 18.04 netplan
  • 3 个回答
  • 5625 Views

Sidebar

Stats

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

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve