Root FTP pass not correct

I used SSH sudo password command to set root password for fto and everything id correct but when i enter to ftp as root and put the pass i get access denied i use WINSCTP and ubuntu server 22.04

Try using sftp instead it should work fine

i used all options
and dosnt work

As @eris said, you should use SFTP instead of FTP if you want to login using root user.

If you still want to use FTP, please, don’t do that, you should edit file /etc/ftpusers and remove or comment the line with root

Hello, i used SFTP and dosnt work either

im using a laptop with ubuntu server btw

I suppose your sshd is configured to not allow root to login or at least not login using a password.

grep -riE 'permitroot|wordauth' /etc/ssh

after i run the command i see this “root@panel:~# grep -riE ‘permitroot|wordauth’ /etc/ssh
/etc/ssh/sshd_config:#PermitRootLogin prohibit-password
/etc/ssh/sshd_config:#PasswordAuthentication yes
/etc/ssh/sshd_config:# PasswordAuthentication. Depending on your PAM configuration,
/etc/ssh/sshd_config:# the setting of “PermitRootLogin without-password”.
/etc/ssh/sshd_config:# PAM authentication, then enable this but set PasswordAuthentication
/etc/ssh/sshd_config.d/50-cloud-init.conf:PasswordAuthentication yes
/etc/ssh/ssh_config:# PasswordAuthentication yes
root@panel:~#”

Your conf by default is using the directive PermitRootLogin prohibit-password and that means that you won’t be able to connect as root user using password, you should use a private key to be able to connect using user root and SFTP. You could also edit the conf file and add PermitRootLogin yes and restart sshd service but I wouldn’t do that.

1 Like

how to get the private key?

You must create it.

In Linux you can issue this command.

ssh-keygen -f ~/.ssh/noxi -t ecdsa -b 521 -N "" -C "root@noxi"

The private key is : ~/.ssh/noxi
The public key is : ~/.ssh/noxi.pub

You should save the private key on your client computer and configure your sftp client to use it.

In your server, you should add the public key to the file /root/.ssh/authorized_keys

cat ~/.ssh/noxi.pub >> ~/.ssh/authorized_keys

If you want to create it on Windows, take a look:

Or you could use an online service like https://keytool.online/ (I wouldn’t use it because the private key should always be private but…)

1 Like

thank you, have a nice day

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.