I connect to server through ssh under vpn. To make project changes I always do the same procedure after accessing server - log as project_user, because with my identity I get sh
shell and I don't have write access to project files.
In my ~/.ssh/config file I tried to use LocalCommand
parameter to automate the procedure:
LocalCommand sudo -iu project_user bash
and then
LocalCommand /bin/sh -c sudo -iu project_user bash
But none of this makes any change - after connecting I'm still in sh
shell and I need to run above commands again and again.
Any ideas?
Update: sorry, but this LocalCommand parameter is meant for local and not remote command. Is there any ssh_config parameter that would let me execute remote command after connecting to server?
Or at least change the shell to bash so that I can execute my command through bash initialization scripts?
ssh .... sudo ... bash -i
– meuh Jul 5 '15 at 16:59sh
shell? – vlad Jul 5 '15 at 17:04ssh -t ...
. – meuh Jul 5 '15 at 17:23sh
shell parse some scripts before starting? – vlad Jul 5 '15 at 18:19ssh -t ... bash --login
. – meuh Jul 5 '15 at 19:00