I have GitBash installed in a windows 7 box and I'm trying to figure out why running:

bash -l ssh

results in

Welcome to Git (version 1.9.0-preview20140217)

Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
bash: /bin/ssh: No such file or directory**

If I do bash -l and after login ssh, it all works fine, so what does bash -l does exactly?

PS: I'm asking this here because I want to know what bash - l does and I do not figure why I can't get it to work on GitBash.

  • "After login ssh". What happens if you run "/bin/ssh" instead? – Mikel Aug 28 '14 at 14:13
  • Also, why are you running bash -l ssh? What are you actually trying to do? – Mikel Aug 28 '14 at 14:16
  • Bash does not, by default, take a command to run as an option - at least not according to man bash on my system. That's what the -c option is for; do you want bash -l -c ssh? The plain bash -l ssh starts a login shell and tries to run a file named ssh as a shell script, whereas your ssh is probably an executable. – Bristol Aug 28 '14 at 14:17
  • Actually I'm trying to understand why I can't get Vagrant to login into the VM I created. From their docs it runs bash -l by default. – Grasshopper Aug 29 '14 at 17:01

bash -l call a login shell.

From bash documentation, Invoking Bash:


Make this shell act as if it had been directly invoked by login. When the shell is interactive, this is equivalent to starting a login shell with ‘exec -l bash’. When the shell is not interactive, the login shell startup files will be executed. ‘exec bash -l’ or ‘exec bash --login’ will replace the current shell with a Bash login shell. See Bash Startup Files, for a description of the special behavior of a login shell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.