Why does vagrant ssh -c ... not run the command?

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

Why does vagrant ssh -c ... not run the command?

Brandon Sussman
vagrant ssh

works - connects me as user vagrant

vagrant ssh -c ls

does the exact same thing - connects me as user vagrant, does not execute the command.

Why?

Verbatim from doc: This should 'execute a single SSH command, prints out the stdout and stderr, and exit'.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does vagrant ssh -c ... not run the command?

Alvaro Miranda Aguilera
vagrant ssh -c 'ls -al'

Alvaro

On Fri, Sep 1, 2017 at 4:43 PM, Brandon Sussman <[hidden email]> wrote:
vagrant ssh

works - connects me as user vagrant

vagrant ssh -c ls

does the exact same thing - connects me as user vagrant, does not execute the command.

Why?

Verbatim from doc: This should 'execute a single SSH command, prints out the stdout and stderr, and exit'.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezcCXh-_kd%2BphMkxP%2BJQp1_trX06%3DUDb7ULj%2BCzmcyuiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does vagrant ssh -c ... not run the command?

Brandon Sussman
1. It would be unusual for quotes to be required whan a parm value is a single word.
2. here is the console output showing the ssh logging in instead of doing what  the doc says it should and the command manually entered with it's output, followed by the standard logout, being ctl-d:

Besides, I do not want ls -al, I want ls.

> vagrant ssh -c 'ls -al'
vagrant@www
:~$ ls  -al
total
40
drwxr
-xr-x 4 vagrant vagrant 4096 Sep  4 11:03 .
drwxr
-xr-x 4 root    root    4096 Sep  3 17:26 ..
-rw------- 1 vagrant vagrant  111 Sep  4 11:06 .bash_history
-rw-r--r-- 1 vagrant vagrant  220 Jan 15  2017 .bash_logout
-rw-r--r-- 1 vagrant vagrant 3486 Jan 15  2017 .bashrc
drwx
------ 2 vagrant vagrant 4096 Jan 15  2017 .cache
-rw-r--r-- 1 vagrant vagrant  773 Jan 15  2017 .profile
-rw-rw-r-- 1 vagrant vagrant   17 Jan 15  2017 shutdown.sh
drwx
------ 2 vagrant root    4096 Sep  3 17:25 .ssh
-rw-r--r-- 1 vagrant vagrant    6 Jan 15  2017 .vbox_version
vagrant@www
:~$ exit
Connection to 127.0.0.1 closed.
>



On Monday, September 4, 2017 at 12:53:29 AM UTC-4, Alvaro Miranda Aguilera wrote:
vagrant ssh -c 'ls -al'

Alvaro

On Fri, Sep 1, 2017 at 4:43 PM, Brandon Sussman <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="_sXinvAoAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">webste...@...> wrote:
vagrant ssh

works - connects me as user vagrant

vagrant ssh -c ls

does the exact same thing - connects me as user vagrant, does not execute the command.

Why?

Verbatim from doc: This should 'execute a single SSH command, prints out the stdout and stderr, and exit'.

--
This mailing list is governed under the HashiCorp Community Guidelines - <a href="https://www.hashicorp.com/community-guidelines.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="_sXinvAoAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/74e2886b-7e7c-469c-823e-c42bf16e4211%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does vagrant ssh -c ... not run the command?

Alvaro Miranda Aguilera
Hello

vagrant ssh -c ls

does ls in the vm

the answer on why you didn't saw any output is probably because was no public files when you tried

'ls -al' is to show all the files and extended attributes

if you try now again it should list that shutdown.sh file at least

Alvaro

On Mon, Sep 4, 2017 at 1:11 PM, Brandon Sussman <[hidden email]> wrote:
1. It would be unusual for quotes to be required whan a parm value is a single word.
2. here is the console output showing the ssh logging in instead of doing what  the doc says it should and the command manually entered with it's output, followed by the standard logout, being ctl-d:

Besides, I do not want ls -al, I want ls.

> vagrant ssh -c 'ls -al'
vagrant@www
:~$ ls  -al
total
40
drwxr
-xr-x 4 vagrant vagrant 4096 Sep  4 11:03 .
drwxr
-xr-x 4 root    root    4096 Sep  3 17:26 ..
-rw------- 1 vagrant vagrant  111 Sep  4 11:06 .bash_history
-rw-r--r-- 1 vagrant vagrant  220 Jan 15  2017 .bash_logout
-rw-r--r-- 1 vagrant vagrant 3486 Jan 15  2017 .bashrc
drwx
------ 2 vagrant vagrant 4096 Jan 15  2017 .cache
-rw-r--r-- 1 vagrant vagrant  773 Jan 15  2017 .profile
-rw-rw-r-- 1 vagrant vagrant   17 Jan 15  2017 shutdown.sh
drwx
------ 2 vagrant root    4096 Sep  3 17:25 .ssh
-rw-r--r-- 1 vagrant vagrant    6 Jan 15  2017 .vbox_version
vagrant@www
:~$ exit
Connection to 127.0.0.1 closed.
>



On Monday, September 4, 2017 at 12:53:29 AM UTC-4, Alvaro Miranda Aguilera wrote:
vagrant ssh -c 'ls -al'

Alvaro

On Fri, Sep 1, 2017 at 4:43 PM, Brandon Sussman <[hidden email]> wrote:
vagrant ssh

works - connects me as user vagrant

vagrant ssh -c ls

does the exact same thing - connects me as user vagrant, does not execute the command.

Why?

Verbatim from doc: This should 'execute a single SSH command, prints out the stdout and stderr, and exit'.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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 vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/74e2886b-7e7c-469c-823e-c42bf16e4211%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ez38Ooko%3DfS8OnsxD4vTsCX5uU8J6iCnkGbAi4xbC_W9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does vagrant ssh -c ... not run the command?

Brandon Sussman

No - thanks for trying but please look at the console log I posted.

' ssh vagrant@vmaddress pwd' works fine.  'vagrant ssh --command pwd' does not.

On Tuesday, September 5, 2017 at 2:44:02 AM UTC-4, Alvaro Miranda Aguilera wrote:
Hello

vagrant ssh -c ls

does ls in the vm

the answer on why you didn't saw any output is probably because was no public files when you tried

'ls -al' is to show all the files and extended attributes

if you try now again it should list that shutdown.sh file at least

Alvaro

On Mon, Sep 4, 2017 at 1:11 PM, Brandon Sussman <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="HAh_cY19AwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">webste...@...> wrote:
1. It would be unusual for quotes to be required whan a parm value is a single word.
2. here is the console output showing the ssh logging in instead of doing what  the doc says it should and the command manually entered with it's output, followed by the standard logout, being ctl-d:

Besides, I do not want ls -al, I want ls.

> vagrant ssh -c 'ls -al'
vagrant@www
:~$ ls  -al
total
40
drwxr
-xr-x 4 vagrant vagrant 4096 Sep  4 11:03 .
drwxr
-xr-x 4 root    root    4096 Sep  3 17:26 ..
-rw------- 1 vagrant vagrant  111 Sep  4 11:06 .bash_history
-rw-r--r-- 1 vagrant vagrant  220 Jan 15  2017 .bash_logout
-rw-r--r-- 1 vagrant vagrant 3486 Jan 15  2017 .bashrc
drwx
------ 2 vagrant vagrant 4096 Jan 15  2017 .cache
-rw-r--r-- 1 vagrant vagrant  773 Jan 15  2017 .profile
-rw-rw-r-- 1 vagrant vagrant   17 Jan 15  2017 shutdown.sh
drwx
------ 2 vagrant root    4096 Sep  3 17:25 .ssh
-rw-r--r-- 1 vagrant vagrant    6 Jan 15  2017 .vbox_version
vagrant@www
:~$ exit
Connection to 127.0.0.1 closed.
>



On Monday, September 4, 2017 at 12:53:29 AM UTC-4, Alvaro Miranda Aguilera wrote:
vagrant ssh -c 'ls -al'

Alvaro

On Fri, Sep 1, 2017 at 4:43 PM, Brandon Sussman <[hidden email]> wrote:
vagrant ssh

works - connects me as user vagrant

vagrant ssh -c ls

does the exact same thing - connects me as user vagrant, does not execute the command.

Why?

Verbatim from doc: This should 'execute a single SSH command, prints out the stdout and stderr, and exit'.

--
This mailing list is governed under the HashiCorp Community Guidelines - <a href="https://www.hashicorp.com/community-guidelines.html" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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 vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - <a href="https://www.hashicorp.com/community-guidelines.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="HAh_cY19AwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/74e2886b-7e7c-469c-823e-c42bf16e4211%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/74e2886b-7e7c-469c-823e-c42bf16e4211%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/74e2886b-7e7c-469c-823e-c42bf16e4211%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/74e2886b-7e7c-469c-823e-c42bf16e4211%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/60483861-edbc-4bd3-aa8d-6f0777a445d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does vagrant ssh -c ... not run the command?

Brandon Sussman
In reply to this post by Brandon Sussman
Interesting solution

'vagrant ssh -- pwd' works!

-- is used in unix to pass options to the program next 'down the line' which is the standard unix ssh on the host.

I do not understand why -c or --command does not work as documented but I don't want to spend today reading ruby :)

On Monday, September 4, 2017 at 7:11:59 AM UTC-4, Brandon Sussman wrote:
1. It would be unusual for quotes to be required whan a parm value is a single word.
2. here is the console output showing the ssh logging in instead of doing what  the doc says it should and the command manually entered with it's output, followed by the standard logout, being ctl-d:

Besides, I do not want ls -al, I want ls.

> vagrant ssh -c 'ls -al'
vagrant@www
:~$ ls  -al
total
40
drwxr
-xr-x 4 vagrant vagrant 4096 Sep  4 11:03 .
drwxr
-xr-x 4 root    root    4096 Sep  3 17:26 ..
-rw------- 1 vagrant vagrant  111 Sep  4 11:06 .bash_history
-rw-r--r-- 1 vagrant vagrant  220 Jan 15  2017 .bash_logout
-rw-r--r-- 1 vagrant vagrant 3486 Jan 15  2017 .bashrc
drwx
------ 2 vagrant vagrant 4096 Jan 15  2017 .cache
-rw-r--r-- 1 vagrant vagrant  773 Jan 15  2017 .profile
-rw-rw-r-- 1 vagrant vagrant   17 Jan 15  2017 shutdown.sh
drwx
------ 2 vagrant root    4096 Sep  3 17:25 .ssh
-rw-r--r-- 1 vagrant vagrant    6 Jan 15  2017 .vbox_version
vagrant@www
:~$ exit
Connection to 127.0.0.1 closed.
>



On Monday, September 4, 2017 at 12:53:29 AM UTC-4, Alvaro Miranda Aguilera wrote:
vagrant ssh -c 'ls -al'

Alvaro

On Fri, Sep 1, 2017 at 4:43 PM, Brandon Sussman <[hidden email]> wrote:
vagrant ssh

works - connects me as user vagrant

vagrant ssh -c ls

does the exact same thing - connects me as user vagrant, does not execute the command.

Why?

Verbatim from doc: This should 'execute a single SSH command, prints out the stdout and stderr, and exit'.

--
This mailing list is governed under the HashiCorp Community Guidelines - <a href="https://www.hashicorp.com/community-guidelines.html" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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 vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/1d3aa196-5458-4482-962f-ca3750be3d83%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/e136850e-8bfe-4828-ba3b-fe906f628718%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.