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?
 
lutadorConnect With a Mentor Commented:
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
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
 
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
 
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
All Courses

From novice to tech pro — start learning today.