Profiles, Very easy!!!

I'am new in Linux, I'am using RedHat 6.0.

I create a file .profile in the default user directory.

When I start a session with the username None of the things I insert in the .profile works.  

How should I do this?

PD 2:
How can I make a default profile so the new users can use it?, or I have to copy the /etc/profile manually?
       
LVL 1
PampaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ahoffmannCommented:
> I create a file .profile in the default user directory.
Then you have to login with the user who uses this directory.

> When I start a session with the username None of the things I insert in the .profile works.
A lot of possible reasons:
  - you have not source this .profile
  - you errors in this .profile
  - you use a shell which does not understand .profile (but probably .cshrc)

> .. or I have to copy the /etc/profile manually?
NO
simply make shure that the user uses a shell (see /etc/passwd) which understands .profile, like sh, ksh
then create a ~/.profile as you like
0
bcolemanCommented:
if you are using bash the profile file should be called .bash_profile in the users default directory.
0
mzehnerCommented:
The file "/etc/profile" is a global file and should work for all users.  The file ".bash_profile" in the user's home directory is for that specific user.  If you are modifying the "profile" file in the "/etc" check to be sure you have set the path correctly for any programs you are trying to run.  You would be best off to specify the full path for each command you give.  To easily find the full path type "whereis command".  For example to find the full path of the mount command, type "whereis mount".  What commands are you running?  Can you give a sample of commands you are trying, that are not working?
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

ahoffmannCommented:
hmm, hope you all know the differences between .profile, .bash_profile, .bash_login etc.
*and* you know when, and in which order they are called. Hope you also know which shell uses which of these resource files.
Also beware of trusting commands like whereis and which, they are giving just hints, which might be the truth, sometimes ...

Pampa, you need yourself make used to user profiles. Otherwise you may get confused about what you want to achieve.
Are your users login in from a console, or is there a GUI for login (xdm). Second, as mentioned before, you need to know which is the login shell, and where are the home directories (both see /etc/passwd)
Then we may give more detailed suggestions.
0
sfurrCommented:
To answer the first part of your question, it all depends on what commands you are trying to run at login.  Most commands are started from .bashrc (IE: alias commands and initializing ls colors).  To answer the second part, there is a directory called /etc/skel/ this directory is what the adduser commands uses to create new users so any file in this directory will be copied to the new users directory.
0
PampaAuthor Commented:
sfurr:
I'am using bash so the first question was answered with bcoleman comment.

About the second question:
I couldn't find the directory you told me "/etc/skel"

ahoffmann says about it:
"simply make shure that the user uses a shell (see /etc/passwd) which understands .profile, like sh, ksh "

I SAW THE /etc/passwd AND POINTS TO BASH

"then create a ~/.profile as you like"

I DO NOT UNDERSTAND THIS COMMENT PLEASE I NEED AN "SPECIFIC" EXPLANATION ABOUT THIS POINT.

Do I have to modify the etc/profile and this would work for every new user???

0
ahoffmannCommented:
>  I'am using bash so the first question was answered with bcoleman comment.
> "then create a ~/.profile as you like"
Ok, it's bash, please read man bash 'cause bash has the most complicated algorithm which resource files are read.
I highly recommend that you
  1'st read man bash
  2'nd remove all .profile .bash* .login .cshrc etc. from the users home dir
  3'rd create new ones
(see my last comment too)

> Do I have to modify the etc/profile and this would work for every new user???
i.g. NO
Just do this if you realy know what you're doing, and what you whant to achieve (as newbie, as you said in your question, I highly recommend to leave the files in /etc untouched !!)

If  you get your changes working, I can give you hints how to make it work for several different users.
0
mzehnerCommented:
bcoleman had the right answer the first time.  You needed to modify the .bash_profile in the user's home directory.  You were making your own .profile in the user's home directory.
0
bcolemanCommented:
The /etc/profile affects every user on the system and every shell type.  The .bash_profile when put in the default user directory will be the new users profile whenever you create a new user.  If you or they want to edit thier/your individual profile they will need to edit /home/<username>/.bash_profile
This file will affect only them/you.
0
ahoffmannCommented:
> The /etc/profile affects every user on the system and every shell type.
NO, NO.

> mzehner, ...
approximately right (means if nobody compiled
 his own bash:)
and if there is a ~/.bash_profile ~/.profile will *not* be read (except you have compiled bash to do it otherwise).

bash is very sophisticated, but complicated too.

WHY DOES NOBODY READ man bash (and sh, jsh, ksh, zsh, csh, tcsh, lsh, tsh, rsh, remsh too)
grrr
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PampaAuthor Commented:
I would like to accept ahoffman answer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.