LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-29-2012, 05:06 PM   #1
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Rep: Reputation: 6
FTP user


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
Attached Thumbnails
Click image for larger version

Name:	1.jpg
Views:	22
Size:	38.1 KB
ID:	11088  
 
Old 10-29-2012, 05:57 PM   #2
SteveThePirate87
Member
 
Registered: Jul 2012
Location: Glasgow, UK
Distribution: Ubuntu Mate 15.04
Posts: 66

Rep: Reputation: Disabled
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
 
Old 10-29-2012, 06:06 PM   #3
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by SteveThePirate87 View Post
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
Attached Thumbnails
Click image for larger version

Name:	2.jpg
Views:	15
Size:	37.3 KB
ID:	11089  
 
Old 10-29-2012, 11:53 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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
 
1 members found this post helpful.
Old 10-30-2012, 07:20 AM   #5
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by chrism01 View Post
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
 
Old 10-30-2012, 04:05 PM   #6
SteveThePirate87
Member
 
Registered: Jul 2012
Location: Glasgow, UK
Distribution: Ubuntu Mate 15.04
Posts: 66

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 10-30-2012, 07:28 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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.
 
1 members found this post helpful.
Old 10-31-2012, 01:08 AM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
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?

Last edited by Wim Sturkenboom; 10-31-2012 at 01:09 AM.
 
Old 10-31-2012, 05:25 AM   #9
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by chrism01 View Post
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.
Attached Thumbnails
Click image for larger version

Name:	sftp.jpg
Views:	8
Size:	31.2 KB
ID:	11113  
 
Old 10-31-2012, 05:30 AM   #10
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by Wim Sturkenboom View Post
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

Last edited by Juc1; 10-31-2012 at 05:37 AM.
 
Old 10-31-2012, 03:42 PM   #11
SteveThePirate87
Member
 
Registered: Jul 2012
Location: Glasgow, UK
Distribution: Ubuntu Mate 15.04
Posts: 66

Rep: Reputation: Disabled
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
 
Old 10-31-2012, 07:52 PM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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 )
 
Old 11-01-2012, 12:32 PM   #13
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by SteveThePirate87 View Post
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 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...

Last edited by Juc1; 11-01-2012 at 12:35 PM.
 
Old 11-01-2012, 11:25 PM   #14
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
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.
 
  


Reply



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
ftp user can't create a directory on ftp server bharatlalgupta Red Hat 4 01-27-2010 01:58 PM
[SOLVED] vsftpd: FTP clients work, ftp://xxxx in mozilla does not. Anonymous user prob? arashi256 Linux - Server 8 01-13-2010 09:31 AM
Anonymous FTP for all, user FTP logins only for specific IP ranges Sjorrit Slackware 15 04-24-2009 02:32 PM
Unable to FTP as user but can FTP as Root acharya_rl Linux - Enterprise 5 09-05-2006 06:57 AM

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

All times are GMT -5. The time now is 09:47 AM.

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
Open Source Consulting | Domain Registration