LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-14-2019, 05:37 AM   #1
megawatt
LQ Newbie
 
Registered: Nov 2019
Location: Hampshire,UK
Distribution: Debian 10.1 Buster
Posts: 19

Rep: Reputation: Disabled
Enabling specific FTP user access to AWS debian 9.5 server


I'm trying to create a userlist for user ftpadmin on an AWS server
but the system keeps saying permission denied even
when I try a sudo cmd version (see below):

echo ftpadmin > /etc/vsftpd.userlist
-bash: /etc/vsftpd.userlist: Permission denied

sudo echo ftpadmin > /etc/vsftpd.userlist
-bash: /etc/vsftpd.userlist: Permission denied

I'm not logged in as user root. I don't know the root password for the AWS debian server yet.

What is going on?

Thank you,
megawatt
 
Old 11-14-2019, 06:04 AM   #2
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,367
Blog Entries: 3

Rep: Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182
Quote:
Originally Posted by megawatt View Post
sudo echo ftpadmin > /etc/vsftpd.userlist
The "> /etc/vsftpd.userlist" part happens outside of sudo, only echo is under sudo. You can write using tee instead if you want to replace the vsftpd.userlist file.

Code:
echo ftpadmin1 | sudo tee /etc/vsftpd.userlist
echo ftpadmin2 | sudo tee -a /etc/vsftpd.userlist
However, I'd say step back and reexamine what you are trying to do. In 2019, FTP should be avoided as much as humanly possible. SFTP would be the way to go because it is world's easier to set up and is there already as part of your SSH service.
 
1 members found this post helpful.
Old 11-14-2019, 06:09 AM   #3
megawatt
LQ Newbie
 
Registered: Nov 2019
Location: Hampshire,UK
Distribution: Debian 10.1 Buster
Posts: 19

Original Poster
Rep: Reputation: Disabled
[QUOTE=SFTP would be the way to go because it is world's easier to set up and is there already as part of your SSH service.[/QUOTE]

Sure I have no problem with that I can connect with sftp using sftp://username@ipaddress but don't have any permissions to copy/edit files.

Trying to upload my html files to the AWS server unsuccessfully

Thank you,
megawatt
 
Old 11-14-2019, 06:18 AM   #4
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,367
Blog Entries: 3

Rep: Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182
You'll need to say more about your set up but if you are trying to place files directly under /var/www/html/ then you'll need to set write permissions there first. Will it be for just the one account or will several accounts need to share write access?
 
1 members found this post helpful.
Old 11-14-2019, 06:21 AM   #5
megawatt
LQ Newbie
 
Registered: Nov 2019
Location: Hampshire,UK
Distribution: Debian 10.1 Buster
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
You'll need to say more about your set up but if you are trying to place files directly under /var/www/html/ then you'll need to set write permissions there first. Will it be for just the one account or will several accounts need to share write access?
I need access just for one account.

Thanks,
megawatt
 
Old 11-14-2019, 06:51 AM   #6
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,367
Blog Entries: 3

Rep: Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182
Then you can use chown to assign ownership of the directory to your account:

Code:
sudo chown username /var/www/html/
If that is the directory. With the EXT4 files system it gets a little more complex later when you have to share the directory among several accounts.
 
1 members found this post helpful.
Old 11-14-2019, 07:29 AM   #7
megawatt
LQ Newbie
 
Registered: Nov 2019
Location: Hampshire,UK
Distribution: Debian 10.1 Buster
Posts: 19

Original Poster
Rep: Reputation: Disabled
[Solved] Enabling specific FTP user access to AWS debian 9.5 server

Quote:
Originally Posted by Turbocapitalist View Post
Then you can use chown to assign ownership of the directory to your account:

Code:
sudo chown username /var/www/html/
If that is the directory. With the EXT4 files system it gets a little more complex later when you have to share the directory among several accounts.
Brilliant! that worked!

Thanks Turbocapitlist,
megawatt

Last edited by megawatt; 11-14-2019 at 02:07 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Amazon spins Ubuntu-driven AWS DeepLens cam and an AWS-savvy Amazon FreeRTOS LXer Syndicated Linux News 0 12-04-2017 04:51 PM
[SOLVED] Add new FTP user & give him specific folder permission only on AWS EC2 taru.tarak Linux - Newbie 2 04-26-2017 01:46 PM
LXer: List of 71 AWS services and their use! AWS cloud terminology! LXer Syndicated Linux News 0 03-17-2017 03:35 PM
Debian 8-NFS-Deny access to specific IP to specific "share" directory george102 Linux - Server 0 06-13-2016 05:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration