Skip to main content
Added one more tag. Corrected some typos.
Source Link
nozimica
  • 894
  • 8
  • 24

I'm using tcsh, and for ana specific project every member of my team connects to a server with the same user. (This is something we cannot change).

The situation arises because I want to have some custom environment variables and aliases, and to do so I have my own tcshrc.tcshrc file (namely .tcshrc_cust) wichwhich I load as the first action when connecting to that machine:

source .tcshrc_cust

and even though this works pretty well, I'm experiencing a problem when using vim: if I get to the shell from inside vim (with :sh) I fall into a normal shell, without my custom env. vars. and aliases.

Is there a solution for this, besides using a different user in that machine?


SOLUTION (given by @Shawn):

I prefixed my key into .ssh/authorized_keys with:

command="setenv subuser noz; tcsh"

and wrote at the end of .tcshrc file these lines:

if ($?subuser) then
    source .tcshrc_$subuser;
endif

And everything works fine now.

I'm using tcsh and for an specific project every member of my team connects to a server with the same user. (This is something we cannot change).

The situation arises because I want to have some custom environment variables and aliases, and to do so I have my own tcshrc file (namely .tcshrc_cust) wich I load as the first action when connecting to that machine:

source .tcshrc_cust

and even though this works pretty well, I'm experiencing a problem when using vim: if I get to the shell from inside vim (with :sh) I fall into a normal shell, without my custom env. vars. and aliases.

Is there a solution for this, besides using a different user in that machine?


SOLUTION (given by @Shawn):

I prefixed my key into .ssh/authorized_keys with:

command="setenv subuser noz; tcsh"

and wrote at the end of .tcshrc file these lines:

if ($?subuser) then
    source .tcshrc_$subuser;
endif

And everything works fine now.

I'm using tcsh, and for a specific project every member of my team connects to a server with the same user. (This is something we cannot change).

The situation arises because I want to have some custom environment variables and aliases, and to do so I have my own .tcshrc file (namely .tcshrc_cust) which I load as the first action when connecting to that machine:

source .tcshrc_cust

and even though this works pretty well, I'm experiencing a problem when using vim: if I get to the shell from inside vim (with :sh) I fall into a normal shell, without my custom env. vars. and aliases.

Is there a solution for this, besides using a different user in that machine?


SOLUTION (given by @Shawn):

I prefixed my key into .ssh/authorized_keys with:

command="setenv subuser noz; tcsh"

and wrote at the end of .tcshrc file these lines:

if ($?subuser) then
    source .tcshrc_$subuser;
endif

And everything works fine now.

Included the solution given by @Shawn
Source Link
nozimica
  • 894
  • 8
  • 24

I'm using tcsh and for an specific project every member of my team connects to a server with the same user. (This is something we cannot change).

The situation arises because I want to have some custom environment variables and aliases, and to do so I have my own tcshrc file (namely .tcshrc_cust) wich I load as the first action when connecting to that machine:

source .tcshrc_cust

and even though this works pretty well, I'm experiencing a problem when using vim: if I get to the shell from inside vim (with :sh) I fall into a normal shell, without my custom env. vars. and aliases.

Is there a solution for this, besides using a different user in that machine?


SOLUTION (given by @Shawn):

I prefixed my key into .ssh/authorized_keys with:

command="setenv subuser noz; tcsh"

and wrote at the end of .tcshrc file these lines:

if ($?subuser) then
    source .tcshrc_$subuser;
endif

And everything works fine now.

I'm using tcsh and for an specific project every member of my team connects to a server with the same user. (This is something we cannot change).

The situation arises because I want to have some custom environment variables and aliases, and to do so I have my own tcshrc file (namely .tcshrc_cust) wich I load as the first action when connecting to that machine:

source .tcshrc_cust

and even though this works pretty well, I'm experiencing a problem when using vim: if I get to the shell from inside vim (with :sh) I fall into a normal shell, without my custom env. vars. and aliases.

Is there a solution for this, besides using a different user in that machine?

I'm using tcsh and for an specific project every member of my team connects to a server with the same user. (This is something we cannot change).

The situation arises because I want to have some custom environment variables and aliases, and to do so I have my own tcshrc file (namely .tcshrc_cust) wich I load as the first action when connecting to that machine:

source .tcshrc_cust

and even though this works pretty well, I'm experiencing a problem when using vim: if I get to the shell from inside vim (with :sh) I fall into a normal shell, without my custom env. vars. and aliases.

Is there a solution for this, besides using a different user in that machine?


SOLUTION (given by @Shawn):

I prefixed my key into .ssh/authorized_keys with:

command="setenv subuser noz; tcsh"

and wrote at the end of .tcshrc file these lines:

if ($?subuser) then
    source .tcshrc_$subuser;
endif

And everything works fine now.

Source Link
nozimica
  • 894
  • 8
  • 24

For a same unix or linux user, different sets of environment variables

I'm using tcsh and for an specific project every member of my team connects to a server with the same user. (This is something we cannot change).

The situation arises because I want to have some custom environment variables and aliases, and to do so I have my own tcshrc file (namely .tcshrc_cust) wich I load as the first action when connecting to that machine:

source .tcshrc_cust

and even though this works pretty well, I'm experiencing a problem when using vim: if I get to the shell from inside vim (with :sh) I fall into a normal shell, without my custom env. vars. and aliases.

Is there a solution for this, besides using a different user in that machine?