Executing command after ssh login

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Executing command after ssh login

Calvin Young
The first thing I always do after I ``vagrant ssh`` into my vagrant box is ``cd /path/to/project``.  Is there any way to automate this so I always land in my project directory after connecting?

With the normal ``ssh`` command, you could do something like the technique that's discussed here: http://serverfault.com/questions/79645/ssh-run-a-command-on-login-and-then-stay-logged-in

Thanks!

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Executing command after ssh login

Mitchell Hashimoto
Calvin,

You can send arbitrary commands to SSH after the "--" in `vagrant ssh`:

`vagrant ssh -- -these -flags -go -to -ssh`

But you can also create a ~/.bashrc and such.

Best,
Mitchell


On Thu, Feb 7, 2013 at 1:22 PM, Calvin Young <[hidden email]> wrote:
The first thing I always do after I ``vagrant ssh`` into my vagrant box is ``cd /path/to/project``.  Is there any way to automate this so I always land in my project directory after connecting?

With the normal ``ssh`` command, you could do something like the technique that's discussed here: http://serverfault.com/questions/79645/ssh-run-a-command-on-login-and-then-stay-logged-in

Thanks!

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.