Commit Graph

91 Commits

Author SHA1 Message Date
Seth Vargo 40336016e1 Use the correct option for sending the environment 2015-11-19 18:08:47 -08:00
Seth Vargo 02a351841e Use an array instead of map 2015-11-19 16:32:43 -08:00
Eli Skeggs 2b9173e15a Support environment variable forwarding, fixes #4131
Signed-off-by: Eli Skeggs <eskeggs@globesherpa.com>
2015-11-19 16:25:54 -08:00
Mitchell Hashimoto eb5a6fc7c3 communicators/ssh: more nil guards [GH-6225] 2015-11-18 17:32:40 -08:00
Clayton O'Neill d863242538 Add Errno::ENETUNREACH to SSH rescue
This changes the ssh ready? method to treat ENETUNREACH the same way as
EHOSTUNREACH errors.

When attempting to SSH into a box, it tries up to 5 times to connect to
the box, ignoring various errors.  Later it will catch and gracefully
handle most of those errors so that callers don't have to know the
details.

However, the Errno::ENETUNREACH error is not caught, which means that
callers that expect a clean boolean return from ready? don't get that,
and instead get an exception they probably aren't expecting.
2015-11-05 15:40:27 -05:00
Mitchell Hashimoto c1508cd893 kernel/v2: customizable sudo_command [GH-5573] 2015-07-09 09:30:47 -06:00
Mitchell Hashimoto dd69de1073 communicators/ssh: only try auth methods that are valid 2015-07-07 16:06:03 -06:00
Aaron Quint 2f81669394 Move shell_cmd to a method in SSH::Communicator
This allows shell_cmd to be overridable by plugins/patches without
having to override the entire (large) shell_execute method
2015-04-13 13:45:17 -04:00
Seth Vargo d2874064f4 Use .key? instead of .has_key? 2015-01-05 18:29:01 -05:00
Mitchell Hashimoto 94b2a8a56b communicators/ssh: insert random key, remove insecure key 2014-10-24 09:58:18 -07:00
Mitchell Hashimoto 381f1332c8 Merge pull request #4670 from gildegoma/dry-check-ssh-perms
Check SSH key permissions in machine.ssh_info
2014-10-23 09:14:31 -07:00
Mitchell Hashimoto 15f16181f5 communicators/ssh: clear out some comments 2014-10-23 09:06:28 -07:00
Konstantin Tretyakov c332287665 Addresses issue #2163
In the situation where the SSH key has invalid permissions/owner, the reconnect-loop keeps failing repeatedly yet stays silent about the reasons. A message must be reported from the default exception handler (added). In addition, the situations where the SSH key owner or permissions are wrong must lead to a proper failure (added). Ideally, though, the owner/permissions check must happen before launching the VM, hence this is not a perfect fix.
2014-10-23 15:11:10 +03:00
Mitchell Hashimoto 5ebd10c19c communicators/ssh: timeout on connection check 2014-10-21 17:00:05 -07:00
Gilles Cornu 4e81be879c Check SSH key permissions in machine.ssh_info
With this change, any caller of machine.ssh_info is assured that best
efforts will be done to fix possible wrong permissions on the private
key files.

Fix #4652
2014-10-20 17:33:06 +02:00
Nicolas Philippe 1bb61fb3f9 Fix for issue #4452 : undefined stdout in communicator.rb
Fixes #4452.
The stdout variable was changed during commit
https://github.com/mitchellh/vagrant/commit/138aa5aad375ac0c076a0e0a3493
e25906ce0434 . This commit just corrects this omission.
2014-09-03 20:47:46 -05:00
Mitchell Hashimoto be6665864d communicators/ssh: nicer errors for SSH exceptions [GH-4367] 2014-08-29 11:40:50 -07:00
Mitchell Hashimoto 138aa5aad3 communicators/ssh: cleanup PTY code for GH-4408] 2014-08-29 09:41:35 -07:00
Leo Simons 87fb5d11fe Preserve exit code while using pseudo-terminal hack. 2014-08-29 11:50:22 +02:00
Leo Simons a0d3719b52 Scrub SSH PTY output to filter out command echo-ing. 2014-08-28 18:02:27 +02:00
Mitchell Hashimoto 0da5d7b650 communicators/ssh: clean error on max session [GH-4044] 2014-08-08 09:11:25 -07:00
Mitchell Hashimoto 5ed0b22c78 communicators/ssh: cleaner error if remote disconnect [GH-4038] 2014-08-07 11:53:44 -07:00
jdmulloy 50d0861de4 Removed extra n from the word "connection"
Removed extra n from the word "connection" in "Attempting SSH connection" in logger call.
2014-06-27 19:27:23 -04:00
Kalman Hazins bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Mitchell Hashimoto 782c3762cc communicators/ssh: rescue another exception for reset 2014-05-09 15:59:15 -07:00
Mitchell Hashimoto 604ae6caa3 communicators/ssh: detect if config.ssh.shell is non-functional [GH-3040] 2014-05-01 21:35:02 -07:00
Mitchell Hashimoto 6721d8e964 communicators/ssh: just use Ruby 2.0 features 2014-04-21 13:54:52 -07:00
Mitchell Hashimoto bd51c16700 provisioners/puppet: execute properly with WinRM 2014-04-21 13:54:00 -07:00
Mitchell Hashimoto ad8d133293 communicators/ssh: throttle warnings [GH-3442] 2014-04-11 16:17:17 -07:00
Mitchell Hashimoto 77c92d0d11 communicators/ssh: only show warnings after a few attempts [GH-3442] 2014-04-11 14:36:19 -07:00
Hiroshi Miura a7cc402258 vagrant ssh accept utf8, fix #2744
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2014-03-30 12:15:53 +09:00
Mitchell Hashimoto f7adeadf8d communicators/ssh: change wording on retry 2014-03-21 17:48:03 -07:00
krazyLee fb4cb4636e fix timout typo 2014-03-11 17:27:47 +08:00
Mitchell Hashimoto c877fc27a7 communicators/ssh: call ready? when waiting
This lets things like the SSH key go in
2014-02-26 11:35:41 -08:00
Mitchell Hashimoto 67a0d3d5f1 communicators/ssh: rescue/show correct error messages 2014-02-23 22:31:37 -08:00
Mitchell Hashimoto 2fe2fe79ed communicators/ssh: properly allow errors through while waiting 2014-02-13 21:04:41 -08:00
Mitchell Hashimoto ed5e544e63 communicators/ssh: more verbose output about waiting for SSH 2014-02-13 20:59:26 -08:00
Mitchell Hashimoto 14b27ae215 communicators/ssh: cache ssh_info
This lowers the number of subprocesses with VirtualBox quite a bit.
2014-02-13 20:34:51 -08:00
Mitchell Hashimoto 3c10bf7721 communicators/ssh: better error message 2014-02-03 12:09:13 +01:00
Justin Campbell a633b7343a Fix wording of upload permission error
SCPPermissionDenied expects a path, and this is most likely the
destination (to) and not source (from).

[#2804]
2014-01-28 13:49:14 -05:00
Mitchell Hashimoto 732a03c1c4 guests/linux: properly quote and insert public key 2014-01-08 15:12:26 -08:00
Mitchell Hashimoto 4c6957b5cf communicators/ssh: if insert_key is false, don't insert a key 2014-01-03 11:29:44 -08:00
Mitchell Hashimoto 54e640b0c9 communicators/ssh: output UI when inserting key 2014-01-03 11:22:05 -08:00
Mitchell Hashimoto b3a9e6a088 insert_public_key cap, and use that if it exists 2014-01-03 11:13:21 -08:00
Mitchell Hashimoto 38e7166a21 communicators/ssh: support passwords 2014-01-03 09:55:34 -08:00
Mitchell Hashimoto 9cd9e6e55d communicators/ssh: add -E to sudo to preserve env 2013-12-03 12:07:14 -08:00
Mitchell Hashimoto 45e09eb677 core: allow multiple private keys [GH-907] 2013-11-25 15:45:39 -08:00
Mitchell Hashimoto 6baab10df4 communicators/ssh: pty can be enabled 2013-11-24 16:48:07 -08:00
Mark Peek d5dcf84d62 Allow the FreeBSD plugin to install without bash [GH-2485]
The default shell is "bash -l" which does not get installed by default
on FreeBSD. This change allows the plugin to override the default shell
and use a known installed shell (sh).
2013-11-22 15:30:12 -08:00
Mitchell Hashimoto f9e4ea9ce8 communicators/ssh: timeout waiting for connection + header [GH-2226] 2013-09-18 09:32:30 -07:00