Connecting to a remote zope console in windows ssh - windows

I followed this tutorial and installed Plone on a Ubuntu 14.04 VPS to play with.
http://docs.plone.org/manage/deploying/production/ubuntu_production.html
As per the tutorial I closed the ports, leaving opened only 22,80,443. As Zope Management is on port 8080 the documentation suggests creating a ssh tunnel:
ssh user#yourhostname.com -L:8080:localhost:8080
That works great when I'm on a Linux or Mac. How can I create the same connection on a Windows machine?

Get putty from http://www.putty.org/
Go to Connection -> SSH -> Tunnles and add configure the tunnel as shown in the following image.
Important hint! Click the Add Button after editing the tunnel settings and afterwards open.
You may use port 8080.

Related

How to disable selinux/iptables in MacOS to visit docker server from Host computer?

I am running a docker container of python server in my computer (MacOS Catalina, the container can connect MySQL and Redis from host computer, the server is running normally, but I can't visit server on host computer), in Linux environment, we need to disable the selinux, firewall and iptables, for example, edit /etc/selinux/config
and type as below
SELINUX=disabled
SELINUXTYPE=targeted
How to disable selinux/iptables in MacOS or how to visit docker server from the Host computer, I already tried to use host.docker.internal instead of 127.0.0.1, but it doesn't work, if I use host.docker.internal in MySQL or Redis config, also failed, I only can use the really IP such as 192.168.1.45 instead of host.docker.internal or 127.0.0.1

how to configure pycharm to ssh a bastion host using putty or OpenSSH

I am trying to ssh a bastion using pycharm PyCharm 2018.1 on a Windows 7 machine using putty.
I found some documentation to ssh a server and this work without any issues:
https://www.jetbrains.com/help/pycharm/tutorial-using-the-product-built-in-ssh-terminal-and-remote-ssh-external-tools.html
For the bastion server, it seems that pycharm doesn't allow such conection (in the config I only see login and server name as parameters). I tried to put in the putty configuration to the bastion server a tunnel to a localhost. On my window machine I see the port of my localhost.
The issue is that I don't manage to connect pycharm to the localhost. It expect a login and a pwd while I just have the localhost name.
I see in a post from last year that "if you are using a bastion host (also referred to as a jump host), you’ll be very happy to know that PyCharm 2017.3 supports SSH config files. Even on Windows."
https://blog.jetbrains.com/pycharm/2017/10/pycharm-2017-3-eap-5/
Any idea how to have it working either with the localhoast of using OpenSSH and SSH config file ?
The issue was the localhost.Using plink directly is working with no problem using same commands than regular ssh: plink.exe -L 9009:server:22 user#bastion. With Putty it doesn't work (first the IP was 0.0.0.0:port instead of 127.0.0.1:port even with the right port pycharm failed to connect with it work when I use plink directly).
This thread was helping: https://serverfault.com/questions/387772/ssh-reverse-port-forwarding-with-putty-how-to-specify-bind-address

Why can't I connect to 127.0.0.1 HortonWorks Dashboard?

I have installed Virtual Box (Version 5.2.0 r118431 (Qt5.6.2)) on Windows 10 and i imported appliance HDP_2.4_virtualbox_v3 (downloaded from here).
I followed the tutorial from here step by step.
The virtual machine is running on the computer from where I am trying to access the Dashboard. I have set up the Host Only Adapter Option on the sandbox so the computer and the virtual machine can communicate
After the CentOs finished booting I am prompt to enter to the ip 127.0.0.1:8888, which is a different address from the tutorial,
and there is no server listening to that address because i get
"127.0.0.1 refused to connect." in the browser.
image here
Run the ipconfig command in your command prompt and identyfy your virtual box's ip under Ethernet adapter VirtualBox Host-Only Network.
Take that ip address and go to your Virtual Box.
Select your appliance and go to Settings->Network->Adapter 1->Port Forwarding.
Replace the Host IP 127.0.0.1 for the port you need 8080, 8888 and so on with the ip of your virtual box that should be sth like 192.168.x.x.
Now start your sandbox, login on it and try to connect in your browser to the new ip set 192.168.x.x:8888.
Use appliance HDP_2.4_virtualbox because in the most recent some linux commands like netstat are considered deprecated and no longer function, which willmake your life harder when trying to debug or identify a networking problem.
If you still encounter issues eith it, reinstall your operating system, reinstall your virtual box and reimport the sandbox, make the changes needed in the Port Forwarding settings and it should be ok.
try to connect using 127.0.0.1 to connect make sure the VM is running make sure there are no errors if there are debug them and at the last straw uninstall the Vm and retry (make sure to make a backup if there are any files)
you can also try to check all the local host ips on your network and try to connect to them
Make sure you set NAT in your VirtualBox network settings:

Connection timeout error for winscp to cloudera vm

I am trying to connect Cloudera VM from my Windows desktop using Winscp for file transfer.
But I am not able to connect it using winscp. It is showing me connection timeout error.
Anybody has any idea how to solve this issue.
Thanks,
Atul
I figure out, bow to do it. The error was I am referring wrong IP address. To know right IP address and connect follow below steps.
First, if the Cloudera VM is running then shutdown it.
Second, go to setting. refer below screenshots
Then start the Cloudera VM again.
Go to terminal.
Type the command ifconfig.
On Consol you will find eth1 - where you have to look for ipnet, next to it is your IP address, which you have to use to connect to VM. note down the address.
Go to windows.
Open Winscp.
Create New Site.
Put the host name as the IP address which we got from consol
Username- cloudera, password- cloudera
Port-22
Click on Save.
Click on login.
Hope this will help.
Thanks,
Atul
I can connect to cloudera VM 5.15 from winSCP from my laptop(windows).
I am using Virtual box.
I have downloaded VM from cloudera official site and then choose option file-import appliance ,it will choose by default Network adapter NAT and then I followed as mentioned below.
add cloudera.quickstart in hosts file
C:\Windows\System32\drivers\etc\hosts
localhost name resolution is handled within DNS itself.
127.0.0.1 localhost quickstart.cloudera
Recommended VirtualBox Configurations
Right click on the VirtualMachine and click Settings
Setup the VM to allow you to copy and paste from that machine to your local and vice-teversa
Click on General -> Advanced
Set Shared Clipboard to Bidirectional
Setup port forwarding from port 2222 to port 22 to allow SSH to the machine
Click on Network -> Advanced -> Port Forwarding
Add a new entry
Name: 2222
Host Port: 2222
Guest Port: 22
Accessing the VM
SSH’ing to the Machine
Default SSH Credentials: cloudera/cloudera
Host to connect to: localhost
Because of the Recommended VirtualBox Configuration above, we’re forwarding connections from port 2222 to 22. So you would want to use port 2222 to connect.
Windows
Open putty/winscp
Use ip as 127.0.0.1
Set 2222 as the port
Connection Type: SSH
Click open
Enter the password

"network error: connection refused", putty error

I am trying to run putty on Windows 7.
I need to run some SSH commands to upgrade Magento. Every time putty gives me this fatal error:
network error: connection refused
I have even tried to use it through winSCP. Note that putty is running fine on my client's side, but for me it's giving me that error every time.
I tried using port 22, 23 and a few others without success. I have also tried with Windows Firewall both enabled and disabled.
Thank you.
Install open-ssh or ssh in target Linux machine solved my problem .
Use below commands:
sudo apt install ssh
sudo systemctl status ssh
sudo systemctl enable ssh
The following are the list of possibilities of this error:
1) Common cause is - Your IP is blocked or not whitelisted in the server which can be done by editing the file at /etc/csf/csf.conf
2) Disable the windows firewall settings and check..
The above two things should work in most of the cases
3) This is very unusual and when the above two options fails it is very difficult to find the solution
In this case the traceroute to the server host or IP works usually but putty fails
port 22 looks normal and working but connection fails and restarting SSH (service ssh restart) also does not work
reboot or restart the server but still fails
Adding IP in firewalls or whitelisting the local IP may not workout
This case generally happens when the server is migrated or new server. IP of the old server might be whitelisted locally, but don't have port 22 open, or some other local filtering is occurring for this new IP but not the old server IP..
In this case you need to change the port to some 522 or 530 some unusual port will help in sorting it out.. The same port you have to use for the SFTP connection also .. where as FTP connections works normally..
or you have to whitelist the IP locally or open the TCP in and out to port 22 if you want to use the port 22..

Resources