LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-15-2009, 09:08 AM   #1
anandkj
LQ Newbie
 
Registered: Jul 2007
Posts: 18

Rep: Reputation: 0
Exclamation Sftp and ssh on different ports


Hi!

I have a server running OpenSSH_4.3p2 and Pure-FTPd. SSH server is listening on a port other than port 22 (Port 45268) and port 22 is blocked on the firewall. I successfully setup sftp on the server and I am able to login and do the get/put operations via sftp. I would like to know if it is possible to run SSH on the same port (45268) and change the sftp port to some other port. My ultimate aim is to disallow ssh access for an ftp user. That is, an ftp user should not be able to login via ssh and should be able to login only via ftp. Switching to rssh may not be a good option as it is a live server. I googled around to see if I can do this with tcpwrappers (/etc/hosts.allow and /etc/hosts.deny), but I could not find a suitable alternative. Please help! Thanks in advance!
 
Old 05-15-2009, 01:56 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
you sound like you're confusing sftp and ftp to some extent. whilst sftp supports a similar user command set to ftp, that's all, it is NOT ftp.

Additionally sftp is a subsystem of ssh, so you wouldn't look to separate them normally. It's possible to look to run two separate instances of sshd on different ports, disabling sftp on one of them, this isn't going to benefit you realistically.

I'd imagine that an ftp user has a dedicated account for that function, so I would look to make that users shell a non-login one, using, for example, scponly - http://www.sublimation.org/scponly/w....php/Main_Page Here, there is no benefit in looking at port numbers at all.
 
Old 05-18-2009, 02:50 AM   #3
anandkj
LQ Newbie
 
Registered: Jul 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Hi acid_kewpie,

Thanks for responding! And sorry for the delayed reply. All I want is encrypted ftp session. I was pointed to sftp first. Seems I can achieve this with TLS option in pure-ftpd. I am yet to look into that. However, I have a doubt:

"It's possible to look to run two separate instances of sshd on different ports, disabling sftp on one of them, this isn't going to benefit you realistically."

Can you please tell me why its not realistic?

Thanks again!!
 
Old 06-01-2009, 09:43 PM   #4
anandkj
LQ Newbie
 
Registered: Jul 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Hi,

There is a solution that works : http://www.minstrel.org.uk/papers/sftp/builtin/
A considerable time is needed to get this rolling (my bad, maybe). At this point of time, I'm stuck!! Got this to work, but somebody changed something and I'm trying to figure it out.
 
Old 06-02-2009, 12:54 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
I didn't say it wasn't realistic, just that it's not generally worth bothering with if you want some ssh for other functions as well. That guide is pretty good for hardening it up a lot though.
 
  


Reply

Tags
different, ports, sftp, ssh


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chroot SSH problem: ssh working, not SFTP & SCP. NaCo Linux - Security 3 02-01-2009 02:23 AM
sftp and ssh kehkok Linux - Networking 4 09-20-2006 02:53 PM
SSH and SFTP sessions BigLar Linux - General 3 04-26-2006 10:18 AM
SFTP and SSH XaViaR Linux - Security 5 07-20-2005 10:18 AM
ssh and sftp help Rex_chaos Linux - Networking 8 03-17-2003 08:12 PM


All times are GMT -5. The time now is 03:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration