First off log in to the server per SSH, we'll use "server" as server's name and admin as the user with sudo rights (for SSH connections you'll need Putty on windows, Terminal on mac OS X and a normal terminal on Linux).
"Whenever people agree with me I always feel I must be wrong." -- Oscar Wilde
2010-08-06
VSFTPD - how to share network drives
First off log in to the server per SSH, we'll use "server" as server's name and admin as the user with sudo rights (for SSH connections you'll need Putty on windows, Terminal on mac OS X and a normal terminal on Linux).
2010-04-25
Cron
If you want to launch script periodically, you'll have to use cron (manual pages are well done). And the ouput of your script, if any, will be sent to the user the cron entry belongs to.
Now i added some script in /etc/cron.daily and i never received any mail from those ones. The user running the script was root, and the script was indeed generating output.
The trick is, you have to specifically add, in the case of /etc/cron.daily, /etc/cron.hourly and the other ones, the following line to your script :
if you want the result sent to root (or any other user/email assuming you set a MTA agent with a relayhost on your box, like postfix).
2010-04-22
Postfix - Linux sending emails
Wow ! i did it in the end, getting Postfix to simply send emails ! That shouldn't be that hard, but somehow, i never had the courage to rtfm to the end. Well, first of, the documentation on the Ubuntu Server Guide is somehow lacking for the very simple task i was trying to achieve. Here's the magic recipe !
Note 1: this howto does not intended to set up a POP3/SMTP server, but only to make Ubuntu send emails, nothing else (to get backup log results from different servers i'm administering). It's done using the version 2.6.5-3 of Postfix.
Note 2: you need a valid email account (and preferably not a free one like gmail, but the kind of your ISP gives you), which means you need to know the address of your SMTP server (smtp.myisp.com), and have a pair login:password that fits.
Note 3: if you don't like vi (and especially if you're working locally) feel free to use any text editor, like gedit on Gnome, for instance.
and set it as follow:
| General type of mail configuration | Satellite system |
| System mail name | mycomputer.local (2) |
| SMTP relay host | smtp.myisp.com (3) |
| Root and postmaster mail recipient | your unix username (4) |
| Other destinations to accept mail for | mycomputer.local (5) |
| Force synchronous updates on mail queue? | No |
| Local networks | leave this blank |
| Mailbox size limit (bytes) | 0 |
| Local address extension character | + |
| Internet protocols to use | ipv4 (6) |
after the line relayhost = smtp.myisp.com add this :
smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_generic_maps = hash:/etc/postfix/generic
sudo touch /etc/postfix/sasl_passwd sudo chmod go-rwx /etc/postfix/sasl_passwd
add/write the line:
then:
add/write the line where senderemail is the name you want, this will be used in th "from" field of all emails that will be sent by postfix, the only important thing being that myisp.com is a valid mail domain:
then:
To test it, issue this command (sending an email only with the name of the machine):
You should receive an email in your myemail@myisp.com inbox account from senderemail@myisp.com. If not, troubleshooting is made easy by looking at: /var/log/mail.log with your favorite text editor/log viewer.
Last thing, if you want to have your local mail forwarded to you, add a /home/user/.forward file in your home directory with the email of your choice (and you can do the same for root, /root/.forward).
- I'll go ahead (yeaah) and pass on the fact that, because of package dependencies -and good ol' logic-, this command could remove something else like exim4, sendmail and other packages that play the same role, that's perfectly ok, if you're the real admin of the machine (ie you know you're not breaking something else). Then again, it could do nothing, or only upgrade because postfix is already there.
- Use any name you want ! it can be any fantasy name, since you're not really going to host a mail server...
- Your isp's SMTP server of course, mhhhh ?
- You're not always root, right ?
- Same as System mail name (TODO: add an explanation)
- But if you know what you're doing, feel free to say all or ipv6
- Don't make me state the obvious