Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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!
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.
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."
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.