Skip to content

How do I FTP to my cPanel domain on my Lightsail instance

0

How can I connect to my Lightsail instance as the user associated with my virtual host so that I can FTP files to my WHM/cPanel instance?

asked a year ago416 views
2 Answers
0

Hello.

With Lightsail, I think you can transfer files using SFTP instead of FTP.
I hope the steps in the document below will be helpful.
https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-connecting-to-linux-unix-instance-using-sftp.html

EXPERT
answered a year ago
  • I've tried that but can't get it to work. If I connect as "ec2_user", I do get a connection but don't have permission to access my virtual host's root directory; if I try to connect as the virtual host user, it refuses the connection!

  • Try setting the directory so that "ec2_user" can access it. First, connect to Lightsail via SSH. After that, try adding "ec2_user" to the directory's owning group.

    ls -la directory-name
    sudo usermod -aG [directory's owning group name] ec2_user
    
  • Thanks. Adding the EC2 user to my virtual host's group has allowed me to connect OK. But when I transfer files using my FTP client, they all transfer under the ownership of the EC2 user! Is there no way of connecting to my WHM instance as the virtual host user?

  • If you can set up SSH for "virtual host user", you can use SFTP. I'm not very familiar with "WHM", but if the "virtual host user" is the same user as normal Linux, it should be possible to set the SSH key as introduced in the blog below. If you set this up and can connect via SSH, you will be able to transfer files using SFTP. https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server
    If the "virtual host user" cannot operate like a normal Linux user, the settings cannot be made, so the only option is to change the file owner using the "chown" command after uploading the file with "ec2_user".

    sudo chown user-name:user-name file-name
    
0

By Default FTP is disabled in cPanel/WHM.

You can enable it from Home / Service Configuration / FTP Server Selection.

Required FTP application will be installed after clicking on Save Button.

CHoose FTP Selection

answered a year ago
  • Don't think that the issue is to do with the FTP service as I'm connecting via SSH. I can connect fine via SFTP using SSH... but not as my virtual host's user. That's the issue!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.