简体   繁体   中英

Use a Vagrant machine as SFTP connection in NetBeans

I have a little trouble using NetBeans to work on my Vagrant virtual server. What I tried is to create a new PHP Project on a remote server, then NetBeans ask me for the connection so I created a new connection. For hostname I putted in 127.0.0.1 and as user vagrant I linked the private key file (generated by vagrant) and filled in the initial directory.

When I try to connect like this it asks me for the password for user vagrant (which I don't have, since it should provide the private key file...). With Vagrant I would need to connect to port 2222 instead of 22 for ssh connections anyway, so I changed the hostname to 127.0.0.1:2222 . Now I get a java.net.UnknownHostException: 127.0.0.1:2222

Therefore the question: Was anyone of you able to connect to a vagrant machine with SFTP using NetBeans? If yes, how?

Note: Not sure if it's important, but I'm using an Ubuntu 14.04 machine and my NetBeans version is 8.0.2, I've installed the PHP/Web package.

I realize this was asked a long time ago, but it seems like other people have this issue as well. This works for me on my Mac:

Host: 127.0.0.1
Port: 2222
Protocol: SFTP
user: vagrant
pass: vagrant

You end up in the vagrant home directory /home/vagrant .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM