I am running a remote putty session from windows to my Red Hat Enterprise Linux server.
Due to company restrictions, I am unable to change my Linux user's default shell from bash to zsh. I instead have read only access to ~./bash_profile
, which executes ~/.bashrc
(where I also have only read only access), which in turn executes ~/.bash_custom
where I have write access. Inside ~/.bash_custom
, I execute zsh to change my shell.
Including the line to execute zsh prevents the execution of any remote command provided by putty. I know this is the problem since if I comment out my execution of zsh it works fine.
I have several aliases and PATH modifications inside my zsh which I'd like to use as part of the remote command executed from putty. How can I pass the remote command from the bash shell to zsh for it to be executed there?
.profile
source.bashrc
because normally,.bashrc
wouldn't even be read when sshing into a machine. Do you have code in your~/.profile
that makes it source.bashrc
? Also, are you opening an interactive shell session or are you just trying to run a single command?.bashrc
when invoked non-interactively over rsh or ssh (with some variation between versions and distributions, IIRC making ssh like rsh was originally a Debian patch).exec zsh
in.bashrc
? I can't think of a good reason to do that. Why not do it in.bash_profile
, so that it's only done in interactive shells?~/.bash_profile
which then executes~/.bashrc
which I also have only read only access to which then executed~/.bash_custom
which I have write access to and which is where I run zsh