I'm implementing a program on my Linux virtual server. For that I use WinSCP and PuTTY.
Should I install my text editor (Sublime Text) on my laptop or on my virtual server and how do I open it from PuTTY?
Another option is rmate
Sublime Text
install package RepoteSubl
Linux Bash Shell
>sudo wget -O /usr/local/bin/rmate https://raw.github.com/aurora/rmate/master/rmate
>sudo chmod a+x /usr/local/bin/rmate
rmate for bash
PuTTY
edit your session
SSH > Tunnels
source port: 52698
destination: localhost:52698
checked: "remote" and "auto"
Connect to Server via SSH (PuTTY)
>rmate file
and the file will open in Sublime Text
edit, save and it will be saved on server
You cannot run local Windows application from PuTTY terminal connected to a remote server.
You can run remote installation of an application on a local X Server from PuTTY terminal though.
Anyway, why do you need to run it from PuTTY terminal? As you are using WinSCP too, why don't you configure the local Windows installation of Sublime Text as an external editor for WinSCP?
https://winscp.net/eng/docs/ui_pref_editor
Alternatively install SFTP plugin to your local installation of Sublime Text.
See How could I run Sublime Text 2 without X server?
Related
After logging into the VM using vagrant ssh using GitBash on Windows 10, I don't see any directory prompts. While it does run the python web forum (for a tutorial on Udacity on Intro to Relational Databases), it won't let me run psql so I can continue the lesson. I can change directories, list information about the files, and run python but the prompt isn't working like normal.
Screenshot here: screenshot.
Please note the forum is running, this screenshot was taken after I exited and restarted vagrant.
Vagrant version 1.9.6
Ubuntu version 16.04.2 LTS
All programs installed or running in administrator mode.
I had the same problem attempting to set up Laravel Homestead - in my case it seems to be an issue with Git Bash / MINGW64.
My work-around was to use PuTTY
Install PuTTY, PuTTYgen
Create a .ppk of the key you're using to connect to the vagrant vm by loading the private key in PuTTYgen and saving the private key
Create a new PuTTY session with your vagrant details, in my case I just copied what was displayed after running "vagrant up" as far as SSH address, username (my PuTTY session Host Name would be "vagrant#localhost" port: 2222)
specify the ppk in the PuTTY configuration under Connection-> SSH-> Auth-> Private key for authentication
In short, try connecting with PuTTY or some other terminal emulator and see if you have any luck.
I wasn't able to get Git Bash to work, but the show window for the Oracle VM VirtualBox Manager does work just fine. I've been using Git Bash to start the VM, then switch to the Oracle VM UI window.
I had the same issue with truing to connect to a virtual Homestead session (Laravel) using virtual box and I was trying to connect via Gitbash MINGW64 as well.
I tried the same in cmd.exe (command: vagrant ssh) and it worked.
So should be issue with Git bash.
I have already found "SSH to Vagrant box in Windows" and added the git bin directory to my windows PATH. I verified that it worked by starting CMD and typing ssh, and got a usage message. (Before adding the git bin directory to my path, CMD complained that ssh wasn't a valid command.)
However...when I run vagrant ssh from MobaXterm, I get the same error I did before. (A page full of ruby errors that aren't helpful to me.) When I run it as VAGRANT_LOG=debug vagrant ssh, I see:
INFO subprocess: Starting process: ["C:\\Users\\(myname)\\DOCUME~1\\MOBAXT~1\\slash\\bin/ssh.EXE"]
This is the wrong ssh executable; it's the one installed in MobaXterm and it doesn't work if run from a CMD window.
How can I get vagrant ssh to work as it should?
Part of the trick is that I don't want to use the Windows PATH for arbitrary commands—not even for ssh, really. I want to use the versions in MobaXterm for everything. All I want is to be able to run vagrant ssh the same way I would on Linux or Mac.
The workaround I have been using, which I found somewhere online (but can't find the page again), is:
vagrant ssh-config > vagrant-ssh
ssh -F vagrant-ssh default # Works exactly the way `vagrant ssh` should
"default" is the box name for a typical Vagrant environment with only a single vagrant box. If there is more than one box, replace "default" with the box name:
ssh -F vagrant-ssh host001 # Works the way `vagrant ssh host001` would on another system
This is a good workaround with minimal changes required to workflow. But I'd still like a way to get vagrant ssh working without needing the extra file in my vagrant directory.
here you can find an explanation
In the documentation, this mention is in the "Terminal tab settings"
section, so you will find this option in the "Terminal" tab.
Go to MobaXterm global settings window, then click on the "Terminal"
tab and check the "Use Windows PATH environment". Note that if you are
using a session, you will have to do the same in this session: edit
your session, then go to the "Terminal settings" tab and check the
"Use Windows PATH" option.
Call me crazy but what about doing this:
Setup Vagrant Virtualbox VM like normal
In MobaXterm, create a "Bash" shell integration with the working directory setup as the directory of the Vagrant directory for the specific VM you are doing this for (aka ... the directory where the Vagrantfile lives for this VM)
In the "Advance Shell Settings", use this command (adjust vagrant path to where ever your Vagrant is installed as MobaXterm bash sees it):
command /drives/c/HashiCorp/Vagrant/bin/vagrant ssh-config >
vagrant-ssh-config && ssh -A -F vagrant-ssh-config default
Vagrant VM needs to be up for MobaXterm Bash entry for the VM to work. I just setup two Bash shell settings for two Vagrant Virtualbox VMs I created and it seems to work just fine.
Updated: I went a little further since I've figured this out .. at least for me I did :). I added additional CMD shell sessions MobaXterm for each of my Vagrant VM. These additional CMD shell sessions do Vagrant halt, up, and restart (combo of halt and up) commands against the VMs they are specific to. This is what restart looks like:
vagrant halt
vagrant up
set /p value="Press Enter to continue"
exit
The Startup Directory for the above session is, again, the directory where the Vagrantfile lives for this VM. Oh, and make sure that "Use Windows PATH" is checked in Terminal Settings.
you can install git (https://git-scm.com/downloads) during install git choose "use git and optional Unix tools from the windows command prompt"
Download msysgit from msysgit project page and include msysgit/bin folder to PATH, now you can run ssh and vagrant ssh form your terminal on windows.
I'm trying to use vagrant ssh in windows console, but it don't work.
Vagrant is correctly installed, and i've installed also Git for windows.
Also, correct path is installed in the system environment, using
setx PATH "%PATH%;C:\Program Files (x86)\Git\bin"
and i can see the path add-on in the console via path and also in the windows system environment.
But when i'm use vagrant ssh in the windows console it give me the usual error:
ssh executable not found in any directories in the %PATH% variable.
Is an SSH client installed? Try installing Cygwin, MinGW or Git, all
of which contain an SSH client. Or use your favorite SSH client with
the following authentication information shown below:
Host: 127.0.0.1 Port: 2222 Username: vagrant Private key:
C:/vagtest/.vagrant/machines/default/virtualbox/private_key
If i digit path in console, i have the correct path with git location, but it is useless.
If i digit
set PATH=%PATH%;C:\C:\Program Files (x86)\Git\bin
the command
vagrant ssh run, but obviusly when i close the console and reopen it, it don't run more.
I really don't understand what happen.
try >vagrant ssh from Git Bash window
To run ssh on windows, you need to download msysgit from msysgit project page and copy the ssh.exe file from msysgit/bin folder to C:\Program Files\Git\bin.
Now try again vagrant ssh from cmd, git cmd or git bash.
Note: if you prefer, you can include the msysgit/bin to path, or copy all the content of msysgit/bin to git/bin.
How can I enable/activate commandline telnet without having admin privileges? I don't wish to use putty. I wish to use native telnet that starts from commandline.
This is not necessarily the answer to activate telnet, but this does answer how to get telnet working from commandlline on windows 7 without having admin privileges and without putty.
Answer is pretty simple:
Install cygwin with inetutils for telnet http://www.question-defense.com/2010/11/30/install-telnet-using-cygwin-on-windows-7,
Add cygwin bin to my local env PATH variable https://superuser.com/questions/25037/change-environment-variables-as-standard-user-windows-7
I am trying to login on my ubuntu server from windows pc using putty ssh but it says connection refused.
I am able lo login on ubuntu using command
$ ssh root#MY-IP-ADDRESS
not able to login using remote server.
Please Help me.
I was having the same issue and nothing was working for me to connect to ec2 linux instance from Windows 7. Here is how i was finally able to connect.
1.) Download puttygen.exe and create a .ppk file from your .pem file that you downloaded from amazon.
2.) Use FireSSH (plug-in for Firefox), put in your host name, use 'ubuntu' (minus the quotes) for the Login, leave password blank and enter the location of the .ppk you created from puttygen.exe
Note: Oddly enough i was not able to connect using putty.exe but the private key it generates works fine with FireSSH
Did you install openssh-server ?
aptitude install openssh-server
Then also check you don't have firewall running on your Ubuntu.