Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-06-29
7
Medium Priority
?
308 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 172 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 164 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 164 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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

730 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