Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to run a script in /etc/profile to setup aliases for all users login thru SSH. But this doesn't work:

alias d='sh /opt/d/'
alias dc='d c'
alias de='d e'

append this to: /etc/profile
. /opt/d/

After login, I type 'd' but it says "command not found". Please help. Thanks. (I'm using Debian5)

share|improve this question

migrated from May 1 '11 at 20:27

This question came from our site for professional and enthusiast programmers.

You login as ? I'm assuming you log ing as root which

(a) by default skips some of the initialization scripts (like /etc/bash_completion e.g.) (b) might run a restricted shell

Could this be (related) to what is happening?

You could do

bash -x -l

to see what happens, and optionally save it to some location for insepction

share|improve this answer
thanks, bash -x -l helped me to debug the problem – May 1 '11 at 20:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.