Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

vagrant ssh -- EXTRA SSH ARGS is supposed to allow extra args to be passed to ssh.

vagrant ssh -- -t 'cd /var/www' should ssh into vagrant and change directory to /var/www, but doesn't. Instead it returns

ssh: Could not resolve hostname ls: nodename nor servname provided, or not known

What am I missing?

question from:https://stackoverflow.com/questions/22523134/running-remote-commands-after-vagrant-ssh

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
286 views
Welcome To Ask or Share your Answers For Others

1 Answer

This works for me:

vagrant ssh -- -t 'cd /var/www; /bin/bash'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...