Mini-Howtos

Want to support HowtoForge? Become a subscriber!
 

How do I search for a term in a file?

With the grep command.

If you want to find out if the term user is in /etc/httpd/conf/httpd.conf, you would run

grep -i user /etc/httpd/conf/httpd.conf

(-i makes the search case-insensitive).

Normally grep does not tell you the line number where it finds the term. If you want to find out the line number, run

grep -n -i user /etc/httpd/conf/httpd.conf

How do I find out who is logged in on my system?

You can find out about logged in users either by running

who

(Sample output:

server:~# who
root     pts/0        Nov 12 11:28 (192.168.0.202)

)

or

w

which gives more detailed output:

server:~# w
 11:29:49 up  2:19,  1 user,  load average: 0.02, 0.01, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    192.168.0.202    11:28    0.00s  0.08s  0.01s w

How do I edit files on the command line?

To edit files on the command line, you can use an editor such as vi. To open the file, run

vi /path/to/file

Now you see the contents of the file (if there is any. Please note that the file is created if it does not exist yet.).

The most important commands in vi are these:

Press i to enter the Insert mode. Now you can type in your text.

To leave the Insert mode press ESC.

One of the users on the system has a CatchAll-email address. He receives all emails, even those for users of another site...

One of the users on the system has a CatchAll-email address. He receives all emails, even those intended for users of another site on the same server. The MTA on the server is postfix.

Please check if the domain of the users that receives all emails is the same as the domain $mydomain in /etc/postfix/main.cf. If this is the case, change $mydomain and run

postfix reload

on the shell.

You should never enter a domain that is used for a virtual site on the server as $mydomain in /etc/postfix/main.cf!

I cannot send and/or receive emails.

Please check if Sendmail/Postfix and your POP3 daemon are running by executing

netstat -tap

You will get a list of all services listening on your server.

If they are running re-configure your firewall (iptables or ipchains) so that the ports 25 (Sendmail/Postfix) and 110 (POP3) are not blocked. If this does not help please check that Sendmail/Postfix is really running on port 25 and your POP3 daemon on port 110.

(Hint for standard RedHat installations: If you have webmin installed and are running Sendmail, go to Webmin->Servers->Sendmail->Sendmail Options. Under SMTP Port Options you often find the following entry:

On sending emails, I get the following error message: "Relaying denied".

There are two solutions for this problem:

1) You configure your MTA to allow authentication via SMTP (SMTP-Auth). Your users then have to change settings in their email clients (e.g. Outlook), i.e., they have to activate Server requires authentication.

2) You install "POP-before-SMTP" or poprelayd on your server. Your users then have to fetch emails first before they are allowed to send emails for a restricted period of time (mostly 30 min.).

How can I find out which Postfix version I'm running?

Just run

postconf -d | grep mail_version

to find out your Postfix version.

first page
previous page
...
15
next page
last page