LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Sftp and ssh on different ports (https://www.linuxquestions.org/questions/linux-general-1/sftp-and-ssh-on-different-ports-726214/)

anandkj 05-15-2009 09:08 AM

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!

acid_kewpie 05-15-2009 01:56 PM

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.

anandkj 05-18-2009 02:50 AM

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!!

anandkj 06-01-2009 09:43 PM

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.

acid_kewpie 06-02-2009 12:54 PM

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.


All times are GMT -5. The time now is 03:31 PM.