Configure user environment ....

I have added a user in the passwd file and now he is allowed to log in. But, how am I going to give him freedom to create his own env and to run scripts.
I have added in some aliases in the root .cshrc/.bashrc file and it works but it doesn't work in the user env, why? Can this be set globally....

What are the important things to do when a new user is added? Pls specify in details.

Pls advise as I'm very new to UNIX/LINUX env. Thanks
qiang8Asked:
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.

ozoCommented:
In what way does the user not have the freedom to create his own env and to run scripts?
Does the user need to set his PATH?
What aliases don't work work in the user env?
0
qiang8Author Commented:
The error is:
/Home/user $ bash:lo:command not found

In local ~/.bashrc or ~/.cshrc files,
it contains simple statement like:
alias lo 'logout'
(this is the file I copied over from root drive) and why the user is not allowed to modify. How can I change it?
I didn't set any path...do I need to do so as a root user? I have no idea about startup scripts.....pls highlight the important points to me.

Pls help me so that I can have a better concept of LINUX o/s. Thanks a lot.

0
qiang8Author Commented:
The error is:
/Home/user $ bash:lo:command not found

In local ~/.bashrc or ~/.cshrc files,
it contains simple statement like:
alias lo 'logout'
(this is the file I copied over from root drive) and why the user is not allowed to modify. How can I change it?
I didn't set any path...do I need to do so as a root user? I have no idea about startup scripts.....pls highlight the important points to me.

Pls help me so that I can have a better concept of LINUX o/s. Thanks a lot.

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!

svindlerCommented:
When you copy root's files to the user, the copies are owned by root. If the files are not accessible to "world" the user cannot acces them.
You have to change ownership of the files to the user.
"chown user.user filename"

The users path has probably been set ok. Be aware that you normally don't look for scripts, programs etc in the current directory ".", unlike windows,  unless you specifically add it to the PATH (which you really shouldn't).
0
qiang8Author Commented:
Is it a must that .login,.profile,.cshrc,.bashrc,.logout must be included in the user working directory. My problem is that the user
cannot execute shell commands that are written in .bashrc or .cshrc files. For example:

..bashrc file:
alias lo 'logout'

The error is:
/Home/user $ bash:lo:command not found

Why the command is not executed? When a simple script is written such as:

my_file:
ls | tail -20 | more

then I change it to be executable form but can't work also. It doesn't appear to be like "my_file*" as in unix which "*" means that it can be executed.

Pls advise.....Thanks experts

0
ozoCommented:
chmod a+x my_file
0
qiang8Author Commented:
Sorry, it can't work......Thanks
0
lutadorCommented:
I am assuming you are using RedHat distribution.  If you want an alias to be global, put the alias line in /etc/bashrc

Follow these steps, to ensure that you are not working with any old mistakes:

1. Login in as root.

2. Your alias line is incorrect.  Add this alias line to /etc/bashrc:
alias lo='logout'

3. Still as root, add new test account:
useradd tester

3. Still as root, set password for "tester":
passwd tester

4. Exit from root account:
exit

5. At the login prompt, login as tester. Once you get in as tester run the following command and it should log you out:
lo

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
qiang8Author Commented:
It doesn't work when I add the alias at /etc/bashrc but it works only in the local ~/.bashrc . Pls advise further and I don't wish to change it for every single user. Anywhere, thanks for ur help and these points are for u.

Thanks ....
0
lutadorCommented:
Please post contents of /etc/bashrc and /etc/.bashrc
0
lutadorCommented:
Also, what is distribution and what version are you using?
0
qiang8Author Commented:
Red Hat 6.0

Contents of /etc/bashrc and /etc/.bashrc
are as follow:

alias h='history | tail -25 | more'

PS1="[\u@\h \W]\\$ "


Thanks.
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 Distributions

From novice to tech pro — start learning today.