• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

RH6.1 wierdness.

A colleagues machine has a bit of a wierdness built in :=)

When he logs on as root he has aliases defined, but as a normal user there are no aliases, all users use tcsh.

More specifically he would like to enable "colored ls" for all users.
  • 3
  • 2
1 Solution
j2Author Commented:
even more wierd, when he logs on the alias command gives

mc      setenv MC `/usr/bin/mc -P !*`; cd $MC; unsetenv MC

but after launching screen, alias returns blank.

root however has the aliases

alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'

regardless if logged on directly, or in a screened session.


Aliases are defined in either the globally, or locally.

Have a look in the root home directory ( /root ), for the local alias files ..

'ls -a' will list the dot-files in root's home directory. You can then see a file called .cshrc or .login or .tcshrc ( note the leading . )

The aliases that are missing from other users are probably defined in one of those files.

If they are you can add them to the global file '/etc/cshrc', '/etc/tcshrc', '/etc/login' ( without the leading dot! ).

I'll guess that the rm, mv and cp aliases are defined in the global file.

The end of the man page for tcsh ( 'man tcsh' ) should tell you the exact names of the files it uses.
j2Author Commented:
Uhm, creating a /etc/tcshrc didnt help, neither did a /etc/cshrc.

creating a local .tcshrc helped. But can we set this globally for all users to have a "skeleton" config?
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.

As you (or your friend) is using RH6.1, there should be a /etc/skel directory, where skeleton profiles are kept. Those are copied when new users are added by using the "useradd" command. I don't know if those files are used if user accounts are added by other methods like linuxconf.

> Uhm, creating a /etc/tcshrc didnt help, neither did a /etc/cshrc.

But did you try /etc/login, as j2 suggested? That *should* do it...

Another point to check may be the access rights to those profile files. A lot of modern shells check that
a) global profiles are not world-writable
b) local profiles are only user-writeable
and don't execute them if not, as they may have been compromised. Some "echo" commands in those files will reveal if they are executed or not.
I've just checked the tcsh man page.. the global files for tcsh are /etc/csh.cshrc and /etc/csh.login. Have a look there for the global settings.

Using /etc/skel is the correct choice to set defaults for all users. It will only work when you setup new users though, it won't change anything for users that already exist.
j2Author Commented:
Redhat seems to have modified that.. because for me .tcshrc is what i need to use, but now i have got the general idea. And since the you gave me the general idea, the points are your. Thanks.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now