LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-23-2004, 11:50 PM   #1
sixth_sense
Member
 
Registered: Mar 2004
Distribution: RedHat
Posts: 99

Rep: Reputation: 15
Angry not getting /etc/aliases file


hi all,

can anyone advice me about /etc/aliases file ?
I need to put some entry on this file but not getting on its place..not even somewhere elses... I made a search and now confirm i don't have that file on my Redhat-9 box.

is this something like i have to make the file manually ? (but i guess, its a system file that creats automatically, cuz on redhat-6.2 i got it right place)


Any idea? Plz help.
 
Old 04-24-2004, 09:14 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
What is this file used for? I don't recall ever having an aliases file in /etc.
 
Old 04-24-2004, 02:08 PM   #3
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
sixth_sense, my aliases live in ~/.bashrc; maybe yours do, too. It's worth a check.

Certainly you should be able to add new aliases to that file in order to accomplish your goal; adding them to any /etc file would be a global setting, and probably not recommended in any case.

Trickykid, aliases are very useful console "shortcuts". You can type 'alias' in a console and see if you have any already set.

For example, here's a couple of mine:

alias kernel="cd /usr/src/linux/"
alias source="cd /usr/local/src/"

So, in a terminal, if I want to go to the kernel directory (because I'm going to make menuconfig or whatever), I don't have to type "cd /usr/src/linux"... I can just type 'kernel' and hit enter, and it will perform that command, because I have told Linux that "kernel" is an alias for the command "cd /usr/src/linux". And you can do this with a lot of commands that you may use often, you can make different aliases for the same command with different switches... it's really useful if you use the terminal or command line a fair bit.
 
Old 04-24-2004, 02:13 PM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
sixth_sense: are you talking about shell aliases? (what motub is talking about) or mail aliases?

My mail aliases file resides at: /etc/mail/aliases
 
Old 04-24-2004, 06:24 PM   #5
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
your mailserver could have an aliases file in the /etc folder, it depends on the mail server.

sendmail has /etc/aliases or /etc/mail/aliases, postfix has /etc/postfix/aliases they could be a link to /etc/aliases but not necessary.

after updating the aliases file run newaliases or sendmail -bi

Last edited by DavidPhillips; 04-24-2004 at 06:28 PM.
 
Old 04-25-2004, 02:21 AM   #6
sixth_sense
Member
 
Registered: Mar 2004
Distribution: RedHat
Posts: 99

Original Poster
Rep: Reputation: 15
well, actually i was going through fresh postfix installation, and somewhere on the postfix documentation (INSTALL) i got it:


"Make sure there is a corresponding alias in /etc/aliases:"
postfix: root


i didn't get any aliases file under /etc directory. but second time when i installed redhat hat then i got the file..(I sureprised!)

anyway...


as you guys told, i got another alias file under "/etc/postfix/aliases"

I really like to know why postfix need me to keep an entry on /etc/postfix/aliases file as "postfix: root"?

----------------------

Hi motub,

just for interest, i maked following entry on my /etc/aliases file:

alias teest="cd /usr/local/postfix-2.0.19/"

and issued "teest" from command line. An error message shows up

-bash: teest: command not found
note, I made the /etc/aliases file manually on my hand... is this the reason?

Any idea?


Thanks all.

Last edited by sixth_sense; 04-25-2004 at 02:24 AM.
 
Old 04-25-2004, 05:36 AM   #7
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
From what I can see, /etc/aliases is a file installed by sendmail, as DavidPhillips said. Do you have sendmail installed?

Second, as bulliver said, what you're trying to add with the "alias teest=" is a shell alias, which commands are not read from /etc/aliases (because /etc/aliases is for sendmail mail aliases; alias is a command and aliases is a file). From all I can find (I've used a lot of distros, but Gentoo is the first one where I've ever used and editied my shell aliases, so I don't know if or how the configuration is different on other distros), shell aliases are best entered in ~/.bashrc, which bash will always look for. This of course assumes that you're using the bash shell in the first place.

You should probably try entering alias without any parameters to see what has been set for you already by RedHat. This will also help because if you know what aliases you already have, you can check to see what file they are being set in and then simply add to it. Check ~/.bashrc first, as that's where they likely are, but if not there, then ~/.bash_profile, if not there, then look at /etc/profile (probably not here, but possible), /etc/profile.local (if it exists) or /etc/bashrc (if it exists). You can do a test of the alias command you're trying to enter by not even trying to enter it in a file, but simply opening a terminal and setting alias teest="cd /usr/local/postfix-2.0.19/" then typing teest immediately in the same terminal. However, this will be forgotten as soon as you close the terminal. If you're satisfied, you can then add it to your .bashrc (where you will likely find the other aliases that were pre-set as well). You might also want to set the aliases you've created in root's .bashrc as well.

Hope this helps.
 
Old 04-25-2004, 12:20 PM   #8
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Just for more clarity: mail aliases are not just for sendmail, they are used by pretty much all MTA's

postfix: root declares that all mail sent to postfix@yourdomain.com get sent to root's mailbox instead of being bounced.

You can set up several aliases such as:
webmaster: root
admin: root
etc...

If you want all of root's mail delivered to your personal mailbox:
root: sixth_sense:

of course change that to your actual username. After editing this file you must run:
'newaliases'

Last edited by bulliver; 04-27-2004 at 02:45 PM.
 
Old 04-27-2004, 02:03 PM   #9
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
I always link postfix's aliases file to /etc/aliases just to have only one of them to edit. Just makes sense to me.

Another thing you can do in your aliases file that's useful..


someuser: user1@domain.com, user2@otherdomain.com, root, david
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
making aliases - no bashrc file disorderly Linux - Newbie 9 09-27-2004 04:57 PM
sendmail Aliases File under Mandrake david.skinner Linux - Software 0 07-18-2004 11:30 PM
creating aliases to run file Squeak2704 Linux - Software 3 04-28-2004 12:40 PM
aliases in .bashrc file davalos Linux - Newbie 7 08-21-2003 01:03 PM
Postfix and the aliases file MasterC Linux - General 5 01-16-2003 03:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration