← 返回命令列表

Linux command

vagrant-ssh 命令

网络

需要网络或远程资源。

常用示例

SSH into VM

vagrant ssh

SSH into specific VM

vagrant ssh [name]

Run command via SSH

vagrant ssh -c "[command]"

SSH without TTY

vagrant ssh -- -T

说明

vagrant ssh opens an SSH session to a Vagrant machine. Automatically handles authentication using generated keys. The primary way to access Vagrant VMs interactively.

参数

-c, --command _cmd_
Execute command.
-p, --plain
Plain SSH without extras.
--
Pass args to ssh.

FAQ

What is the vagrant-ssh command used for?

vagrant ssh opens an SSH session to a Vagrant machine. Automatically handles authentication using generated keys. The primary way to access Vagrant VMs interactively.

How do I run a basic vagrant-ssh example?

Run `vagrant ssh` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c, --command _cmd_ do in vagrant-ssh?

Execute command.