Score:2

vsftpd issue can't load RSA Certificate

gb flag

This is my configuration for vsftpd:

anonymous_enable=NO

local_enable=YES

userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/vsftpd/user_list

write_enable=YES

local_umask=022

dirmessage_enable=YES

xferlog_enable=YES

xferlog_std_format=YES


chroot_local_user=YES

listen=YES

pam_service_name=vsftpd
tcp_wrappers=YES

# script to init pem:
# sudo mkdir -p /etc/ssl/private
# sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem

rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem

ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES

ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO

ssl_ciphers=HIGH

pasv_address=XXXXXXXXXXXXX 
#pasv_addr_resolve=NO

pasv_enable=YES
pasv_min_port=49152
pasv_max_port=49200
port_enable=YES

allow_writeable_chroot=YES

I generated the RSA certificate with the command sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem

Pilot6 avatar
cn flag
Are you using Ubuntu? What is the error you get?
tommy avatar
gb flag
yes sorry, ubuntu 22.04
Pilot6 avatar
cn flag
You have `rsa_cert_file` and `rsa_private_key_file` the same file.
tommy avatar
gb flag
@Pilot6: 500 OOPS: SSL: cannot load RSA certificate
Score:0
cn flag

You need to generate two different files: a key file and a certificate file.

You sent them to the same /etc/ssl/private/vsftpd.pem

sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/ssl/private/vsftpd.key -out /etc/ssl/private/vsftpd.pem

Also update vsftpd config:

rsa_private_key_file=/etc/ssl/private/vsftpd.key
tommy avatar
gb flag
I have still same error, I restared the vsftpd service: ```vsftpd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT``` ```
tommy avatar
gb flag
```rsa_cert_file=/etc/ssl/private/vsftpd.pem rsa_private_key_file=/etc/ssl/private/vsftpd.key```
tommy avatar
gb flag
also in the vsftpd.conf the certificate says: ```# sudo mkdir -p /etc/ssl/private # sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem # We need to specify the location of our certificate # and key files. We actually combined both pieces of # information into a single file, so we will point # both options to the same file:```
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.