Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Adding a proftpd user to /var/www

  1. #1
    Join Date
    Oct 2004
    Beans
    282
    Distro
    Ubuntu 16.04 Xenial Xerus

    Adding a proftpd user to /var/www

    Hi all,

    What is the command line for adding a user with password to access the /var/www folder through Filezilla?

    I presently have proftpd + TLS installed on Ubuntu 11.04 Server (32bit)

    I can disable TLS if need be. When I log in I do see the certificate I created, but cannot get past that.

    I also opened ports 20 & 21 on the firewall.

    This is the error I am getting:
    Code:
    Status:	Resolving address of hcctech.ca
    Status:	Connecting to 108.21.187.192:21...
    Status:	Connection established, waiting for welcome message...
    Response:	220 FTP Server ready.
    Command:	AUTH TLS
    Response:	234 AUTH TLS successful
    Status:	Initializing TLS...
    Status:	Verifying certificate...
    Command:	USER userftp
    Status:	TLS/SSL connection established.
    Response:	331 Password required for userftp
    Command:	PASS ***********
    Response:	530 Login incorrect.
    Error:	Critical error
    Error:	Could not connect to server
    I did try to create a user (userftp) by following one of the how-to's, but it isn't helping.

    I really would like full direct access directly to my web folders.

    Thanks

    Heeter
    Last edited by Heeter; September 7th, 2011 at 07:13 AM.

  2. #2
    Join Date
    Feb 2009
    Location
    Delft, Netherlands
    Beans
    39
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Adding a proftpd user to /var/www

    First of all take a good look at your ftp session: its error is in the authentication of the user. I see you try to log in using the "userftp" username. I'm not a pro in Linux (installed my first server a couple of days ago, my main PC is still Windows), but as far as I understand proftpd this is a user for the software to use to get access rights to the physical folders to read and write in, this is not a useraccount for remote users trying to log in to your FTP.

    The explanation given here helped me enough to get it working. Did you restart proftpd after having changed the config file?

    Good luck!

    PS: Please let me know if any of this helped or what the problem turned out to be. I'm a n00b in this myself, and would like to learn!

  3. #3
    Join Date
    Oct 2004
    Beans
    282
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Adding a proftpd user to /var/www

    Hi David,

    That is exactly the howto I used.

    I will take a look at it again.

    I would like to have direct access to my /var/www folder, not somewhere in a home folder. The I have to go move it around in the server after that.

    Heeter

  4. #4
    Join Date
    Oct 2004
    Beans
    282
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Adding a proftpd user to /var/www

    Can anyone help, please

    Thanks

    I followed that howto again,

    I am still getting the same error as above.

    Thanks


    Heeter

  5. #5
    Join Date
    Feb 2009
    Location
    Delft, Netherlands
    Beans
    39
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Adding a proftpd user to /var/www

    Heeter,

    Changing the home directory is not too difficult. In the guide we both used they tell to set the home directory to /home/FTP-shared/, if you replace that with /var/www/ that should help:

    Code:
    sudo useradd userftp -p your_password -d /var/www -s /bin/false
    sudo passwd userftp
    You should then also proceed to change the directory specifications in the /etc/proftpd/proftpd.conf file. I modified one entry from the example in the guide:
    Code:
    <Directory /var/www>
    Umask 022 022
    AllowOverwrite off
    	<Limit MKD STOR DELE XMKD RNRF RNTO RMD XRMD>
    	DenyAll
    	</Limit>
    </Directory>
    The next two entries should be modified similarly, I think you get the idea.

    The error you got in your first post looked like some authentication error. I would try setting the password for userftp to a really simple one and making sure that you've added userftp to the #VALID LOGINS sections of the proftpd.conf file.

    I'm not sure whether you are immediately trying to get the users to login to the /var/www folder, but if so I would recommend to first get it to work exactly as in the example. Then start to change stuff around. This will make finding the problem easier.

    Good luck!

  6. #6
    Join Date
    Oct 2004
    Beans
    282
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Adding a proftpd user to /var/www

    Thanks a million for your help so far.

    Following your direction, I have managed to get past the login,

    Now I am getting this error:

    Code:
    Status:	Resolving address of hcctech.ca
    Status:	Connecting to 107.20.185.192:21...
    Status:	Connection established, waiting for welcome message...
    Response:	220 FTP Server ready.
    Command:	USER userftp2
    Response:	331 Password required for userftp2
    Command:	PASS *******
    Response:	230 User userftp2 logged in
    Command:	SYST
    Response:	215 UNIX Type: L8
    Command:	FEAT
    Response:	211-Features:
    Response:	 LANG en-US.UTF-8*;en-US
    Response:	 MDTM
    Response:	 MFMT
    Response:	 TVFS
    Response:	 AUTH TLS
    Response:	 UTF8
    Response:	 MFF modify;UNIX.group;UNIX.mode;
    Response:	 MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
    Response:	 PBSZ
    Response:	 PROT
    Response:	 SITE MKDIR
    Response:	 SITE RMDIR
    Response:	 SITE UTIME
    Response:	 SITE SYMLINK
    Response:	 REST STREAM
    Response:	 SIZE
    Response:	211 End
    Command:	OPTS UTF8 ON
    Response:	200 UTF8 set to on
    Status:	Connected
    Status:	Retrieving directory listing...
    Command:	PWD
    Response:	257 "/" is the current directory
    Command:	TYPE I
    Response:	200 Type set to I
    Command:	PASV
    Response:	227 Entering Passive Mode (10,220,27,45,130,113).
    Status:	Server sent passive reply with unroutable address. Using server address instead.
    Command:	MLSD
    Error:	Connection timed out
    Error:	Failed to retrieve directory listing
    This is what I have in my proftpd.conf file:
    Code:
    #VALID LOGINS
    <Limit LOGIN>
    AllowUser userftp2
    AllowUser userftp
    DenyALL
    </Limit>
    
    <Directory /var/www/>
    Umask 022 022
    AllowOverwrite off
            <Limit MKD STOR DELE XMKD RNRF RNTO RMD XRMD>
            DenyAll
            </Limit>
    </Directory>
    
    <Directory /home/FTP-shared/download/*>
    Umask 022 022
    AllowOverwrite off
            <Limit MKD STOR DELE XMKD RNEF RNTO RMD XRMD>
            DenyAll
            </Limit>
    </Directory>
    
    <Directory /home/FTP-shared/upload/>
    Umask 022 022
    AllowOverwrite on
            <Limit READ RMD DELE>
            DenyAll
            </Limit>
    
            <Limit STOR CWD MKD>
            AllowAll
            </Limit>
    </Directory>
    
    <Directory /home/FTP-shared>
    Umask 022 022
    AllowOverwrite off
            <Limit MKD STOR DELE XMKD RNRF RNTO RMD XRMD>
            DenyAll
            </Limit>
    </Directory>
    Heeter
    Last edited by Heeter; September 9th, 2011 at 06:38 AM.

  7. #7
    Join Date
    Oct 2004
    Beans
    282
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Adding a proftpd user to /var/www

    Well,

    By changing filezilla client to "Active" from "Default", I now see my /var/www folder.

    Now I cannot upload (or delete) anything into it. I can download, but cannot upload or delete either.

    Must be a permissions setting, but where?

    I am almost there..............


    Heeter
    Last edited by Heeter; September 9th, 2011 at 07:31 AM.

  8. #8
    Join Date
    Feb 2009
    Location
    Delft, Netherlands
    Beans
    39
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Adding a proftpd user to /var/www

    As far as I can see, your proftpd.conf file (as you posted it two posts ago) is set to deny access rights to the /var/www folder:

    Code:
    <Directory /var/www/>
    Umask 022 022
    AllowOverwrite off
            <Limit MKD STOR DELE XMKD RNRF RNTO RMD XRMD>
            DenyAll
            </Limit>
    </Directory>
    The capital arguments in the <limit> tags specify ftp commandos, and these, more specifically the MKD and STOR commandos are set to DenyAll. MKD and STOR are ftp commandos used for MaKing Directories and STORing files respectively, and these are denied to all users. I believe you should be able to write to the file if you remove these commands from the <limit>'s arguments, and add a second set of limit tags to this directory specification in order to allow these commands, something like this:
    Code:
    <Limit MKD STOR >
       AllowAll
    </Limit>
    BE CAREFULL: you now give each user write rights, which may be undesirable for you from a security perspective. I would recommend to read the "advanced" section of the guide again or google around to limit these rights to certain users if you wish to set up your server in a secure way.

    Hope this helps!

  9. #9
    Join Date
    Oct 2004
    Beans
    282
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Adding a proftpd user to /var/www

    Thanks a million, for your great assistance,

    Not too worried about security, As I am the only one with access to this server.

    Here is new updated file:
    Code:
    #VALID LOGINS
    <Limit LOGIN>
    AllowUser userftp2
    AllowUser userftp
    DenyALL
    </Limit>
    
    <Directory /var/www>
    Umask 022 022
    AllowOverwrite off
            <Limit DELE XMKD RNRF RNTO RMD XRMD>
            DenyAll
            </Limit>
            <Limit MKD STOR>
            AllowAll
            </Limit>
    </Directory>
    Still not working, same as before.

    So I tried this:
    Code:
    <Directory /var/www>
    Umask 022 022
    AllowOverwrite on
            <Limit MKD STOR DELE XMKD RNRF RNTO RMD XRMD>
            AllowAll
            </Limit>
    </Directory>
    And Still I cannot upload to the folder

    Could it be that the server is simply not allowing At all uploads to the /var/www folder?


    Heeter

  10. #10
    Join Date
    Feb 2009
    Location
    Delft, Netherlands
    Beans
    39
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Adding a proftpd user to /var/www

    Hi,

    Have you checked that the ftpuser account has linux write rights on the /var/www folder? Otherwise proftpd will not be able to write to these folders as userftp.

    The part about setting user rights is explained in the guide you used before, just before step 3. The code they give there is
    Code:
    cd /home
    sudo chmod 755 FTP-shared
    cd FTP-shared
    sudo chmod 755 download
    sudo chmod 777 upload
    Writing rights are given here to the upload directory, so you should do something similar to your /var/www folder, I suggest you look up some documentation or tutorials on chmod in order to fully understand what's going on.

    Good luck!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •