I have setup ec2 ubuntu server successfully. Able to connect ec2 instance via ftp as well. But that is the default "ubuntu" user and gives control to all system. So I want to create a new user and allow them access to /var/www
folder and they can not see anything else. Even sharing a private key is dangerous. I have been googling for last one day but not able to find any solution. Don't have much linux server knowledge but by following steps, I able to achieve it.
I created one user with password via terminal, allowed set that new user's home dir to /var/www
and tried to connect via filezilla. But could not connect and gives error ECONNREFUSED - Connection refused by server