FTP Help

Swerved

New Member
Hello all. Bear with me; I'm still a little new at linux, but I'm enjoying the heck out of it so far. Before I get to my issue, here's a little background information:

I have a machine I am dual booting on for the time being. I've got Mint 18.2 Cinnamon along side Windows 10. There are a total of 3 drives in the system; one is an SSD that both the operating systems share. The other two were (and still are) my storage drives (NTFS), labeled "ARCHIVES" and "ARCHIVES 2".

So anyway in setting up my ftp, I ran across a few problems. The one I'm having the most trouble getting around is that I want to make the (virtual) users' home directory a folder contained on ARCHIVES - It would be ARCHIVES/Archives (I know, how original, right?). But if I assign the ARCHIVES/Archives as the home, all of a sudden the users can't log in anymore, as seen below:

Command: USER test2
Response: 331 Password required for test2
Command: PASS **********
Response: 530-Unable to set anonymous privileges.
Response: 530 Login incorrect.
Error: Critical error: Could not connect to server
The login credentials are 100% correct. So I guess what I'm asking is, what do I need to do to be able to use ARCHIVES/Archives as the users' home directory? The config file is a variation of the generic "standard" one that gadmin suggests, so I'm sure it leaves much to be desired. I have posted it below:

Code:
ServerType standalone
DefaultServer on
Umask 022
ServerName "0.0.0.0"
ServerIdent off "My FTP Server"
ServerAdmin [email protected]
IdentLookups off
UseReverseDNS off
Port 21
PassivePorts 49152 65534
#MasqueradeAddress None
TimesGMT off
MaxInstances 30
MaxLoginAttempts 3
TimeoutLogin 300
TimeoutNoTransfer 120
TimeoutIdle 120
DisplayLogin welcome.msg
DisplayChdir .message
User nobody
Group nobody
DirFakeUser off nobody
DirFakeGroup off nobody
DefaultTransferMode binary
AllowForeignAddress off
AllowRetrieveRestart on
AllowStoreRestart on
DeleteAbortedStores off
TransferRate RETR 220
TransferRate STOR 250
TransferRate STOU 250
TransferRate APPE 250
SystemLog /var/log/secure
RequireValidShell off
<IfModule mod_auth_pam.c>
AuthPAM off
</IfModule>
AuthUserFile /etc/gadmin-proftpd/users/proftpd.passwd
AuthGroupFile /etc/gadmin-proftpd/users/proftpd.group
<IfModule mod_tls.c>
TLSEngine off
TLSRequired off
TLSVerifyClient off
TLSProtocol SSLv23
TLSLog /var/log/proftpd_tls.log
TLSRSACertificateFile /etc/gadmin-proftpd/certs/cert.pem
TLSRSACertificateKeyFile /etc/gadmin-proftpd/certs/key.pem
TLSCACertificateFile /etc/gadmin-proftpd/certs/cacert.pem
TLSRenegotiate required off
TLSOptions AllowClientRenegotiation
</IfModule>
<IfModule mod_ratio.c>
Ratios off
SaveRatios off
RatioFile "/restricted/proftpd_ratios"
RatioTempFile "/restricted/proftpd_ratios_temp"
CwdRatioMsg "Please upload first!"
FileRatioErrMsg "FileRatio limit exceeded, upload something first..."
ByteRatioErrMsg "ByteRatio limit exceeded, upload something first..."
LeechRatioMsg "Your ratio is unlimited."
</IfModule>
<Limit LOGIN>
  AllowUser brett
  AllowUser test
  DenyALL
</Limit>
<IfModule mod_facts.c>
FactsAdvertise off
</IfModule>

<Anonymous /media/chris/ARCHIVES/Archives>
User test2
Group ftpgroup
AnonRequirePassword on
MaxClients 10 "The server is full, hosting %m users"
DisplayLogin welcome.msg
DisplayChdir .msg
<Limit LOGIN>
Allow from All
Deny from all
</Limit>
AllowOverwrite off
<Limit LIST NLST  RETR  PWD XPWD  SIZE  STAT  CWD XCWD  CDUP XCUP >
 AllowAll
</Limit>
<Limit STOR STOU  APPE  RNFR RNTO  DELE  MKD XMKD SITE_MKDIR  RMD XRMD SITE_RMDIR  SITE  SITE_CHMOD  SITE_CHGRP  MTDM >
 DenyAll
</Limit>
</Anonymous>

<Anonymous /home/ftpuser>
User test
Group ftpgroup
AnonRequirePassword on
MaxClients 10 "The server is full, hosting %m users"
DisplayLogin welcome.msg
DisplayChdir .msg
<Limit LOGIN>
Allow from All
Deny from all
</Limit>
AllowOverwrite off
<Limit LIST NLST  RETR  PWD XPWD  SIZE  STAT  CWD XCWD  CDUP XCUP >
 AllowAll
</Limit>
<Limit STOR STOU  APPE  RNFR RNTO  DELE  MKD XMKD SITE_MKDIR  RMD XRMD SITE_RMDIR  SITE  SITE_CHMOD  SITE_CHGRP  MTDM >
 DenyAll
</Limit>
</Anonymous>
Many thanks in advance!
 


TechnoJunky

Silver Member
Silver Supporter
I'm willing to bet the issue is filesystem permissions. Do a 'ls -al /ARCHIVES' and see what the ownership and permissions are for it's sub-directory /Archives. I bet that it's mounted using your info Swerved:Swerved. You'll need to create a group and put your FTP ID(s) in it, then change the permissions to the directory to maybe Swerved:FTPUsers. Then you need to make sure the group has enough rights to the directory Archives. I would assume since it's their home directory it would be read/write/execute 770? If you don't understand what I'm talking about here, just reply and I'll explain more.
 

Swerved

New Member
I'm willing to bet the issue is filesystem permissions. Do a 'ls -al /ARCHIVES' and see what the ownership and permissions are for it's sub-directory /Archives. I bet that it's mounted using your info Swerved:Swerved. You'll need to create a group and put your FTP ID(s) in it, then change the permissions to the directory to maybe Swerved:FTPUsers. Then you need to make sure the group has enough rights to the directory Archives. I would assume since it's their home directory it would be read/write/execute 770? If you don't understand what I'm talking about here, just reply and I'll explain more.
Ok, I did what you said. The Swerved account has nothing to do with ownership or group; it's all listed under the admin account for Mint which is 'chris'; both owner and group... I'm going to set the group access up like you recommended. I can see that being the issue. I'll let you know how it turns out..

Thanks!
 

Swerved

New Member
UPDATE--

So, on running the command you asked me to run, it shows the owner and group for the mounted drive as "chris" which is my Administrator account on the machine. So I tried to first change the group to "ftpusers", both through the GUI and then through a root terminal by typing " chgrp -R ftpusers ARCHIVES/Archives".. It acts like it changes the group, but doesn't; It stays as "chris".. same thing in the GUI, just goes right back to "chris".. I assume it has to do with being a mounted file system.. silly question, but do the ownership and group stuff migrate over from windows since it is ntfs and was set up as a windows drive? So as for right now, I am not able to change ownership or group. Weird thing is, I actually had it working a few days ago and it worked just like I wanted it to just by working on the config file. Unfortunately I suck about documenting changes I made and didn't save the working configuration. Lesson learned there. Anyway let me know if you think of anything.


Thanks again.
 

Condobloke

Well-Known Member
You are running Linux Mint Cinnamon 18.2.....do you have Timeshift set up, and active ?
 

Condobloke

Well-Known Member
 

Swerved

New Member
So uhm.. yeah I got it working. Only thing is, I'm not 100% sure why but it is. I made a group for the users, but the ARCHIVES volume will not let you change it since it's a Windows drive (NTFS).. but the users are actually system users and for some reason it just started allowing connections. The strange thing is, it doesn't matter what I put for group on the users.. I can put blah_blah and it still works. Gonna go comb through the log files to find out what exactly was the problem.... and download Timeshift.

Thanks for the help!
 

Swerved

New Member
*** ANOTHER UPDATE ***

Ok so I found out why I kept getting the Error: 530 Incorrect Login when trying to access my FTP. Turns out, the server was doing everything right after all, and the configuration was adequate (I'm sure it could be improved upon). The problem came from not being able to assign the mounted ARCHIVES drive as the home directory. Proftpd apparently doesn't like that for some reason. As suggested to me it was a permissions thing, but I couldn't change them. Well, a little further reading on The Mint Forums, how to get the drive to auto-mount at boot I stumbled across a way to change the permissions on the whole drive, which is how I wanted to do this is the first place. Now my admin account can see the contents of the whole drive, and the other users are restricted to their home directory. If anyone is interested it is below in hopes that someone having the same issues stumbles across this (even though it's old)...

Went to "Disks" and selected the drive. Then clicked on settings (the little gears), then selected "Edit Mount Options". I turned off the switch labeled "Automatic Mount Options". Then I checked the two boxes below it that said "Mount At Startup" and "Show In User Interface". Then I changed the drop down labeled "Identify As" to the LABEL=ARCHIVES option, hit OK, then closed Disks.

Then in a terminal, i did the following:
sudo chown -R $USER:$USER /media/$USER/{MOUNT NAME}

You can use the one below as an alternative, depending on where your symlinks for your mounts are..

sudo chown -R $USER:$USER /mnt/{MOUNT NAME}

That was it! Worked like a charm and killed two birds with one stone. Now the ftp is working (correctly) and the NTFS drive mounts automatically on start-up. May seem trivial to many of you, but this is only my 3rd day or so learning to navigate linux.. I'm pretty happy about it. Every time I solve a problem, Bill Gates' grasp on me loosens a little bit.

I don't know how it works with other distros, but it works for Mint 18.2... I would imagine Ubuntu is pretty much the same.
 

wizardfromoz

Super Moderator
Staff member
Gold Supporter
Mate yer a living legend - good problem solving skills :D



(Wizard appears in a puff of smoke)

Another Chris, eh? (I am one)

On LM 18.2 you may already have Timeshift. Try System Tools or Admin.

Tony George's Timeshift was introduced into Linux Mint with 18.3 and then backported to 18.2, 18.1 and 18.0.

Read my Thread on it here

https://www.linux.org/threads/timeshift-similar-solutions-safeguard-recover-your-linux.15241/

... and if you have any questions on it, ask over there.

Welcome to linux.org and enjoy your Linux :D

Chris Turner
wizardfromoz
 

Condobloke

Well-Known Member
@Swerved ...WOW !!.......impressive stuff.
 

wizardfromoz

Super Moderator
Staff member
Gold Supporter
This OS runs so much smoother and more efficiently..
... than Windows?

Welcome to the wonderful world of LInux.

Wizard
 

Members online

No members online now.

Latest posts

Top