Solved

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

Posted on 2006-06-29
7
307 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

635 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