I check with help connecting using filezilla and so far no luck. Currently running MacOS and filezilla running perfectly. It just dont connect?
I finally being able to setup root, and 2nd user to connect to the droplets using SSH from terminal. However not from filezilla.
Disconnected: No supported authentication methods available (server sent: publickey)
that is the error message and yes I try to include the private key along and filezilla will convert the key into ppk. However the error continue.
For connecting to my centOS do I need to install an any new apps in the server? sFTP server?
Anyone with a solution?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
There should not be any special setup required. All droplets include an SFTP service by default (this is provided by the SSH service). I’d recommend checking out the tips here on using an ssh key with Filezilla on Mac. Make sure you select port 22 and protocol: SFTP.
This comment has been deleted
You’ll normally receive that error when you have a valid user but the user doesn’t have a file like the one below; incorrect permissions on the .ssh
directory and the authorized_keys
file may result in the same error.
/home/username/.ssh/authorized_keys
Your root
user should be able to connect as long as your public key is in the file below and it has the proper permissions.
/root/.ssh/authorized_keys
For non-root
users, you need to go a little further and setup SFTP for each one. You can do this relatively easily by following the steps I’ve outlined below.
I’ll use myuser
as the username in this example.
…
Create SFTP Group
groupadd sftpgroup
Create the Home & .ssh Directories
mkdir -p /home/myuser/.ssh
Create User & Set Home Directory
useradd -d /home/myuser -s /bin/nologin myuser
Set myusers’ Password
passwd myuser
Add User to SFTP Group
This will append the user to the new SFTP Group instead of changing the users default group. That’s intentional.
usermod -aG sftgroup myuser
Create the authorized_keys File
touch /home/myuser/.ssh/authorized_keys
Setup Proper Directory & File Permissions
chmod 700 /home/myuser/.ssh
chmod 644 /home/myuser/.ssh/authorized_keys
chown myuser:myuser /home/myuser/.ssh
Modify SSH Configuration
nano /etc/ssh/sshd_config
Find:
Subsystem sftp /usr/lib/openssh/sftp-server
Replace with:
Subsystem sftp internal-sftp
Below:
UsePAM yes
Add:
Match Group group-sftp-only
ChrootDirectory %h #set the home directory
ForceCommand internal-sftp
X11Forwarding no
AllowTCPForwarding no
PasswordAuthentication yes
Now restart SSH - service ssh restart
.
Adding a SSH Key for myuser
The file /home/myuser/.ssh/authorized_keys
is where the public key needs to be pasted to.
nano /home/myuser/.ssh/authorized_keys
Paste in your Public Key (the key starting with ssh-rsa ....
) and save the file.
Creating a Few Test Directories for myuser
mkdir -p /home/myuser/{public,private,logs}
chown -R myuser:myuser /home/myuser/*
Login to SFTP on Port 22
With all of that out of the way, you should now be able to login using SFTP on Port 22 as long as the public key is correct and the steps above have been followed.
This comment has been deleted