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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-15-2009, 09:08 AM
|
#1
|
LQ Newbie
Registered: Jul 2007
Posts: 18
Rep:
|
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!
|
|
|
05-15-2009, 01:56 PM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
05-18-2009, 02:50 AM
|
#3
|
LQ Newbie
Registered: Jul 2007
Posts: 18
Original Poster
Rep:
|
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!!
|
|
|
06-01-2009, 09:43 PM
|
#4
|
LQ Newbie
Registered: Jul 2007
Posts: 18
Original Poster
Rep:
|
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.
|
|
|
06-02-2009, 12:54 PM
|
#5
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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 01:02 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|