LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   FTP user (https://www.linuxquestions.org/questions/linux-newbie-8/ftp-user-4175434669/)

Juc1 10-29-2012 05:06 PM

FTP user
 
1 Attachment(s)
Hi all,

My user can get to the relevant files in SSH but in FTP he starts with .bashrc etc (attached) and I can't start seem to move out of this directory in filezilla.

Can I change the directory in which the user begins an FTP session - or any other suggestions please?

Thank you

SteveThePirate87 10-29-2012 05:57 PM

Hi,

When you connect in to the FTP in the port option use port 22 which usually takes you into the /home directory.

Hope this helps

Steve

Juc1 10-29-2012 06:06 PM

1 Attachment(s)
Quote:

Originally Posted by SteveThePirate87 (Post 4817728)
Hi,

When you connect in to the FTP in the port option use port 22 which usually takes you into the /home directory.

Hope this helps

Steve

Thanks but if I use port 22 I get 'critical error, could not connect to server' (attached).

Thanks

chrism01 10-29-2012 11:53 PM

ssh (port 22) and ftp (ports 20,21) are separate tools.
If you want to get into your home dir and copy files, use scp or sftp; both are part of the ssh tool.
A good GUI client tool (free) is Filezilla which can do regular ftp or sftp.

It can get more complex for ftp http://slacksite.com/other/ftp.html

Juc1 10-30-2012 07:20 AM

Quote:

Originally Posted by chrism01 (Post 4817842)
A good GUI client tool (free) is Filezilla which can do regular ftp or sftp.

Ok thanks but I am using Filezilla (see screenshot on my previous post). This user works ok in SSH but in Filezilla he seems to be stuck and can't move (screenshot in my first post). :(

Thanks

SteveThePirate87 10-30-2012 04:05 PM

I thinks what chrism01 is meaning is in your hostname, rather than using ftp.domainname.com use sftp.domainname.com instead. This is another method to give a try that i've seen work successfully in some occasions.

chrism01 10-30-2012 07:28 PM

Using Filezilla, I've always just (separately) supplied user, passwd, host (or IP) and then specified port 22 in the portnum input box.
It will then use sftp and connect to port 22.
You don't need an sftp.domainname.com entry in your DNS.

Wim Sturkenboom 10-31-2012 01:08 AM

I can not provide the answer how to change the directory. But your user is jailed to his/her home directory. In general, you don't want ftp users to snoop around anywhere else in the system.

Can you provide some kind of context as to the why you want the ftp user to get outside his/her home directory? Is it a webserver? Or a dedicated system with one user only?

Juc1 10-31-2012 05:25 AM

1 Attachment(s)
Quote:

Originally Posted by chrism01 (Post 4818567)
Using Filezilla, I've always just (separately) supplied user, passwd, host (or IP) and then specified port 22 in the portnum input box.
It will then use sftp and connect to port 22.
You don't need an sftp.domainname.com entry in your DNS.

OK thanks - I just changed the protocol in filezilla from FTP to STFP (no port) and it works ie I can back up my data.

Juc1 10-31-2012 05:30 AM

Quote:

Originally Posted by Wim Sturkenboom (Post 4818705)
I can not provide the answer how to change the directory. But your user is jailed to his/her home directory. In general, you don't want ftp users to snoop around anywhere else in the system.

Can you provide some kind of context as to the why you want the ftp user to get outside his/her home directory? Is it a webserver? Or a dedicated system with one user only?

It is a webserver with two websites. I just want FTP users to be able to back up the website data. The website paths are /var/www/vhosts/example.com/httpdocs

Thanks

SteveThePirate87 10-31-2012 03:42 PM

Glad it worked for you, if your issue is resolved then could you mark it as solved on the thread tools so other users might benefit from this solution.

Cheers

Steve

chrism01 10-31-2012 07:52 PM

Glad it worked. As I say, you can just put port 22 on the main screen and it assumes sftp (& vice versa as you've discovered :) )

Juc1 11-01-2012 12:32 PM

Quote:

Originally Posted by SteveThePirate87 (Post 4819216)
Glad it worked for you, if your issue is resolved then could you mark it as solved on the thread tools so other users might benefit from this solution.

Cheers

Steve

Ok done - thanks to SteveThePirate87 and chrism01. Urgent problem fixed = I can now back up my data in filezilla :D There is still Wim Sturkenboom's point about correct permissions - at the moment I think this SFTP user can go anywhere which is not good but this is not urgent so I can come back to this or find some stuff to read on user permissions...

Thanks...

Wim Sturkenboom 11-01-2012 11:25 PM

Multiple roads lead to Rome, I guess. I'm just too lazy to figure all of them out and the one that works for me is to have the websites somewhere in the home-directories of the users. It requires a slight modification of the webserver's configuration to change the document roots.

That way, the jail works as intended.


All times are GMT -5. The time now is 10:37 AM.