Solved

proper file to set up aliases for 1. individual users 2. specific groups  3. all users

Posted on 2006-06-29
7
306 Views
Last Modified: 2010-04-20
been googling to try to find this, and now more confused than I was when I started.

I've got several boxes that multiple users use, a mix of RHEL4 and a few gentoo.  xdm is running on all but one gentoo box, so that's how most users connect.  Several open up bash konsoles, and a few open up ksh shells

What are the generally recognized files used set up aliases that a user will have when s/he logs in, and that won't get overwritten on some update?

What is the generally recognized file used for global aliases, that won't get overwritten on some update?

What are the generally recognized files used for setting up configuration and environment and add aliases and such for specific groups (e.g. accounting, warehouse, admin, powerplant)

Thanks
0
Comment
Question by:amlp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
7 Comments
 
LVL 5

Accepted Solution

by:
ircpamanager earned 43 total points
ID: 17011087
If i understand you correctly,  each user has a file called .bash_profile and .bashrc in there home directory. They store the individual settings for that users. There is a global file in /etc/profile. As far as group names are concerned they are stored in a file under the /etc directory(/etc/group) RHEL4 has a gui tool if you prefer under system settings called users and groups. Again this is if I understand you correctly.
0
 
LVL 22

Assisted Solution

by:pjedmond
pjedmond earned 41 total points
ID: 17011444
Nice little overview of users and groups:

http://yolinux.com/TUTORIALS/LinuxTutorialManagingGroups.html

although written for yolinux, it is equally applicable to other distros.

(   (()
(`-' _\
 ''  ''
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17021023
>What are the generally recognized files used set up aliases that a user will have when s/he logs in, and >that won't get overwritten on some update?

>What is the generally recognized file used for global aliases, that won't get overwritten on some update?

I presume that you are referring to /etc/aliases, but this is for sendmail

man aliases

for more info.

(   (()
(`-' _\
 ''  ''

0
 
LVL 3

Assisted Solution

by:bryanlloydharris
bryanlloydharris earned 41 total points
ID: 17025635
There are many files for this.  Some global and some only for the user.  User settings override global settings AFAIK.

global:
/etc/profile
/etc/bashrc (this is not on my system but it's on the one at work)

not-global(these are only for the bryan user):
/home/bryan/.bash_profile
/home/bryan/.bashrc

Since I'm a beginner, my config looks like this, to simplify things.  This way, it doesn't matter much because they are both the same:

$ vi .bashrc (and put in your settings)
$ ln -s .bashrc .bash_profile (this makes them both the same)

/home/.bash_profile -> .bashrc (this means it's a symlink, both files have same content)

So if you do "cat .bashrc" and then "cat .bash_profile" they will both be the same.  Sometimes the shell reads .bashrc and sometimes .bash_profile.  It depends if you login at console, remote ssh, or xterm, and so on.  To make things simple, I read a book which says create a symlink and don't worry about it because they are then all the same.  I can't remember the name of the book but it might be "Linux Hacks."
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17026113
Example .bashrc
-----------------8X------------------
[pje@bigserver pje# cat .bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
-----------------8X------------------

As you can see, this file creates a number of user specific aliases and also runs /etc/bashrc. The 'default' home set up for a new user normally exists in the /etc/skel directory. By having this default setup copied into the home directory of a new user, then you could change 'alias' directives for all users using bash sh by editing /etc/bashrc

(   (()
(`-' _\
 ''  ''
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question