The Official *nix Thread

Inane baanter or words of wisdom - you decide...
Post Reply
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

RageMatrix wrote:Is there a way to set it so that the FTP user cannot leave its designated home directory?
You require the spell of "chroot", young apprentice: "passwd_chroot_enable=YES" is needed for vsftpd, I think.

http://www.google.co.uk/search?q=vsftpd%2Bchroot <-- some links there.

I moved from wu_ftp through proftpd and vsftpd before settling upon pure-ftpd. If you're doing serious FTP stuff, look at using pure instead, enabling ftps.

Oh, and don't forget to enable PASV on your FTP server, as well as specify a load of (high) ports in vsftpd.conf and NAT these through the router. Else transfers will be slow, or things will stall once you've logged in. Caught me oot a few times, that.
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Thankee :) Got the chroot figured earlier today - but the other stuff is useful too. Going to dig into the conf file some more tomorrow. Just downloaded an SSH client for my PalmTX, which is kinda cool.
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Junosix
Baaaaa!
Baaaaa!
Posts: 1959
Joined: Sun Jul 14, 2002 4:12 pm 0
Location: Plymouth

Re: The Official *nix Thread

Post by Junosix »

How sexy is anyone here with Postfix? One of the businesses I look after has a BT Connect internet connection and it seems BT are playing around with port 25 if you're not using their own authenticated SMTP server, meaning that emails sit in the outbox for about 15 seconds before going. We could of course use BT's SMTP server but that would mean the email header would include @btconnect.com rather than the businesses' domain name, not looking quite so professional.

They already have a Samba fileserver running Ubuntu Hardy server edition, so I'm thinking - use Postfix on that so that emails could be shovelled off to it and get sent in their own time. It wouldn't really be sorting the 15-second-delay thing, but giving the illusion that things are going from the local outbox on each PC quickly.

The only thing is I'm just not getting my head around Postfix, at all. I don't think I necessarily need it to act as an SMTP server in its own right (as I believe it can be used?) I just need it to be the recipient of any outgoing emails, then throw them across to the mail server that's provided by the hosting company that the business uses.

Got any ideas, loves?
wicked skills
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Uh, I use Postfix with BT Connect, but we're hosting our own mail server here, so not really sure what you mean. I'm sure Dungeon Dave will be along shortly to tell you what you need to know :D Sorry - I only know a little bit about Postfix myself, unless I'm not getting the question.

I have a question too :D

I've got Apache running on a non-standard port. I've also installed Resin J2EE server. What I want to be able to do is configure Apache to process all normal HTML/PHP/whatever stuff it does normally, but to shunt all JSP/Servlet stuff to the Resin server. I'm sure theres a way to do this, although I'm a little hazy on how the output is handled - would Resin send its output back to Apache or what? How would I configure the ports for this setup? Virtual name-based hosting or something perhaps?
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

Junosix wrote: so I'm thinking - use Postfix on that so that emails could be shovelled off to it and get sent in their own time....

... I don't think I necessarily need it to act as an SMTP server in its own right
Yes, you do.

It'll act as an SMTP server to your internal mail clients, accepting SMTP connections from the LAN and forwarding the incoming mail to a upstream SMTP server (smart host) which will be BT's mail service. You're effectively replicating BT's server locally to accpt and forward on.

What you're talking about in your last statement (I think) is that you don't want your SMTP server to accept connections from outside and relay mail on - you're using POP3 for that on your local clients. Postfix can handle that okay, essentially it'll be configured to only accept incoming connections from LAN so that external attempts at port25 are ignored.

There are a number of sites documenting this kind of setup - google should uncover many. The tricky part is getting your head around so many configuration directives, but as a simple guide those configs are there for:
- who do I accept mail from?
- when I accept it, what @domain address do I append?
- what mailboxes do I drop it into (local delivery)
- what scanners/AV/antispam am I using, and where?
- how do I reroute mail for a specific domain(s)

Many of these you won't need - but if you want help on a setup then have a crack at creating your own main.cf then prod me if you get into problems. I ain't going to set it up for you - it's important that you know WHY it's set up in that manner yourself - but I can advise based on what I know.

Hope that helps.

coupla links: here and here
Last edited by Dungeon-Dave on Thu Jul 10, 2008 1:26 pm 0, edited 1 time in total.
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

RageMatrix wrote:Uh, I use Postfix with BT Connect, but we're hosting our own mail server here, so not really sure what you mean. I'm sure Dungeon Dave will be along shortly to tell you what you need to know
Close - but maybe you can take a look at his main.cf and explain some of the directives. You know enough to get mail servers up and running.
but to shunt all JSP/Servlet stuff to the Resin server
If the resin server is listening on a specific port, then mod_rewrite or mod_redirect will work happily. Fecks your logfiles a bit, mind.
If resin is only applicible for specific file extensions (.jsp, for instance) then it's possible to tell Apache to use a different handler for those kinds of files in that specific directory.

I don't know enough about resin... but I reckon it's possible. Just the specifics of *how* currently elude me.
User avatar
koogy
Baaa!
Baaa!
Posts: 475
Joined: Thu Aug 31, 2006 11:16 am 0

Re: The Official *nix Thread

Post by koogy »

RageMatrix wrote:...Apache to process all normal HTML/PHP/whatever stuff it does normally, but to shunt all JSP/Servlet stuff to the Resin server.
at work we use mod_jk. apache handles flat stuff, all the .jsp requests (or certain paths) get handled by jboss (or any other ajp13 compliant server)

a quick google also brings up something called mod_resin but it all seems to be in japanese.
User avatar
koogy
Baaa!
Baaa!
Posts: 475
Joined: Thu Aug 31, 2006 11:16 am 0

Re: The Official *nix Thread

Post by koogy »

there's information on using apache as a front end on the resin website:

http://caucho.com/resin/doc/install-apache.xtp
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

koogy wrote:there's information on using apache as a front end on the resin website:

http://caucho.com/resin/doc/install-apache.xtp
Got this going, thanks.
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

I'm running a pretty secure FTP service (vsftpd) in a chroot jail. The one username and password are pretty obscure so I'm not likely to be hacked (and they'd only get my FTP directory anyway), but every now and then some joker (currently from Mexico) tries to run a dictionary attack which obviously fails constantly :D

I just was wondering if I could enable a function that would disallow attempted failed logins for a set period of time for vsftpd to help discourage this bone-headedly crude hack attack, which looks like an autmated piece of software coupled with some sort of obvious dictionary file.

Any ideas?
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Kemper_Boyd
Sheepie Whore
Sheepie Whore
Posts: 11967
Joined: Wed Jul 31, 2002 9:15 pm 0

Re: The Official *nix Thread

Post by Kemper_Boyd »

User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Okay, I'll look into that. Surprised that such a thing isn't included in vsFTPd though.
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

Consider also moving FTP to another port (21021 or so) and binding a fake service (or another FTP server but defunct) on 21 to deter dictionary-attacking sniffers.

Just be warned with fail2ban - there are some vulns with earlier versions where someone can spoof 0.0.0.0 and fool F2B into self-DoS.
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Good idea moving the port, ta. The guy is still at it, although hes not having such luck :) I'm saving the results to a file.
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
dom
Baaaaa!
Baaaaa!
Posts: 1370
Joined: Wed Feb 09, 2005 1:17 pm 0
Location: Edinburgh, UK and level 691859
Contact:

Re: The Official *nix Thread

Post by dom »

Sorry for the long quote, but I'm a little concerned about how apt-get works, as I've not made any non-standard customisations to this new Ubuntu Server install, but it seems to be keeping back the very packages I would want to ensure are at the latest version and upgrading some pretty fundamental things too... can someone please direct me to the part of the documentation where the reasons behind this behaviour are explained? I imagine it's related to what the manpage says about "changing the install status of another package", but how do I see more information on this?

Code: Select all

...
Hit http://gb.archive.ubuntu.com hardy-updates/universe Packages
Hit http://gb.archive.ubuntu.com hardy-updates/universe Sources
Hit http://gb.archive.ubuntu.com hardy-updates/multiverse Packages
Hit http://gb.archive.ubuntu.com hardy-updates/multiverse Sources
Reading package lists... Done
dominic@bungle:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  linux-image-server linux-server openssh-client openssh-server
The following packages will be upgraded:
  libc6 libc6-dev libc6-i686 tzdata
4 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Need to get 9553kB of archives.
After this operation, 4096B disk space will be freed.
Do you want to continue [Y/n]? n
Abort.
dominic@bungle:~$
cheers

Dom
OMG (or oligodendrocyte myelin glycoprotein) is a molecule found in your central nervous system.
Post Reply