Vagrant Manual vagrantfile-ssh Settings config.ssh

Source: Internet
Author: User
Tags deprecated manual ssh ssh port

Original address

Configured namespaces: CONFIG.SSH

The settings in CONFIG.SSH are related to how the configuration Vagrant access your computer via SSH. As with most Vagrant settings, it is common to use the default settings, but you can also fine-tune them to your liking. 1. Available Setup Items config.ssh.username

Sets the SSH user name that Vagrant uses by default. If provider detects a more appropriate user, it is free to overwrite the content. By default, this is "vagrant" because this is the user name used by most public box. Config.ssh.password

Sets the password for the SSH user who authenticates the Vagrant. It is recommended that you use a key-based authentication (reference Private_key_path) instead of a password. If a password is used, Vagrant is automatically inserted into the key pair if Insert_key is true. Config.ssh.host

The host name or IP address to connect to with SSH. The default is empty, because provider is usually found automatically. Config.ssh.port

The port to connect to with SSH. The default is 22. Config.ssh.guest_port

The port on the guest (SSH) is running on. This was used by some providers to detect forwarded ports for SSH. For example, if the are set to (the default), and Vagrant detects a forwarded port to port in the guest from Port 45 On the host, Vagrant'll attempt to use port 4567 to talk to the guest if there are no other option.
The port on the client that is running SSH. This is used by some provider to detect the forwarded SSH port. For example, if set to 22 (the default), and Vagrant detects a forwarding port for client port 22 from Port 4567 on the host, Vagrant will attempt to use port 4567 to talk to the client (if there is no other port) option. Config.ssh.private_key_path

The path of the private key used by SSH to access the client. By default, this is the unsecured private key that is provided with Vagrant because this is the private key used by the public box. If you create your own custom box with a custom SSH key, you should point to that private key.

You can also specify multiple private keys by setting them to an array. This is useful, for example, if you use the default private key to boot the machine, but later replace it with a more secure key. config.ssh.keys_only

Use only the SSH private key provided by Vagrant (do not use any private keys stored in the SSH proxy). The default is true. Config.ssh.verify_host_key

Perform strict master key validation. The default value is False. config.ssh.paranoid

Perform strict master key validation. The default value is False.

deprecated config.ssh.paranoid option is deprecated and will be removed in a future release. Use the Config.ssh.verify_host_key option instead. config.ssh.forward_agent

If true, proxy forwarding is done via an SSH connection. The default is False. config.ssh.forward_x11

If true, enables X11 forwarding over an SSH connection. The default is False. config.ssh.forward_env

An array of host environment variables to be forwarded to the client. If you are familiar with OpenSSH, you will find this corresponds to the sendenv parameter.

Config.ssh.forward_env = ["Custom_var"]
Config.ssh.insert_key

If the true,vagrant will automatically insert a key pair for SSH, replace if the Vagrant default unsafe key is detected inside the machine. is true by default.

This setting will work if you have not already authenticated with the private key, or if you rely on the default unsafe key. If you do not need to be concerned about security in your project, and you want to continue using the default unsafe key, set it to false. Config.ssh.proxy_command

Command-line command for execution to receive data to be sent to SSH on stdin. This can be used to proxy SSH connections. The%h in the command is replaced by the host, and%p is replaced with the port. Config.ssh.pty

If true, Pty will be used for provisioning. The default is False.

This setting is an advanced feature and should not be enabled unless absolutely necessary. It breaks some of the other features of Vagrant and is exposed only when absolutely necessary. If you can find a way to not use Pty, it is recommended to use.

When pty is enabled, be aware that the command output is not streamed to the UI. Conversely, once the command is complete, the output is delivered to the UI. config.ssh.keep_alive

If the TRUE,SSH will default to send a keep-alive packet every 5 seconds to maintain the validity of the connection. Config.ssh.shell

The shell to use when executing the SSH command from Vagrant. The default is Bash-l. Note that this has no effect on the shell that was obtained when running vagrant SSH. This configuration option only affects the shell that is used when executing commands inside Vagrant. config.ssh.export_command_template

The template used to generate the exported environment variables in the active session. This is useful when using a shell such as C shell that is incompatible with Bourne. The template supports replacing two variables with the required environment variable key and environment variable values:%env_key% and%env_value%. The default templates are:

config.ssh.export_command_template = ' export%env_key%= '%env_value% '
Config.ssh.sudo_command

The command to use when executing commands with sudo. The default is Sudo-e-H%c. %c will be replaced by the command being executed. config.ssh.compression

If set to False, this setting will not include the compression setting when SSH enters the machine. If it is not set, it will default to true and Compression = yes will be enabled using SSH. config.ssh.dsa_authentication

If set to False, this setting will not include dsaauthentication when SSH logs on to the computer. If not set, the default is true and Dsaauthentication=yes will be used with SSH. Config.ssh.extra_args

This settings value was passed directly into the SSH executable. This allows-pass any arbitrary commands to does things such as reverse tunneling down into the SSH program. These options can either is single flags set as strings such as "-6" for IPV6 or an array of arguments such as ["-L", "800 8:localhost:80 "] for enabling a tunnel from host Port 8008 to Port, on guest.
This setting value is passed directly to the SSH executable file. This allows you to pass any command to perform tasks such as reverse tunneling into an SSH program. These options can be to set a single flag to a string, such as "6" for IPV6, or ["-L", "8008:localhost:80"] as an array of parameters to enable tunneling from host port 8008 to port 80 of the client.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.