The reason your
~/.bash_profile are not read is that you
are not using an interactive login shell. A “normal” login, e.g. via
creates an interactive login shell, in contrast to executing
commands provided as argument to
ssh, which use a non-login shell.
An interactive non-login bash reads the files
If you want to change the directory for interactive login shells,
cd /some/dir to one of the following files. The first one
found, is being processed, the others are ignored.
If your user name or host name is too long to type, create an alias
~/.bash_profileis being read, it looks like you are using an interactive non-login shell. Only login shells read those files. However an interactive SSH session starts a login shell. Is your
~/.bashrc, it actually gets added, but twice! what's going on?
alias ssh-server='ssh -t user@server "cd /some/dir/ ; bash"'. I am now wondering what's the meaning of that
bashat the end, and whether is affecting something
.bashrc. If you want to change your shell, use
chsh. If you want to save some typing, create a shorthand in