How to connect to remote server using linux ssh tunel command - linux

I have an easy-one here, I'm new using linux to connect to other linux server, the issue is that on a remote server which I can reach from my vpn, I have a GUI running on the port x.x.x.x:6500
I did not have any problem using putty/xshell to make a tunnel to the server and then to see the GUI in my laptop using the localhost:6500.
I'm trying to do the same on my Manjaro VM but I'm having troubles to see the GUI since there. The page says connection refused...
I'm using the following command:
$ ssh -L 6500:127.0.0.1:6500 x.x.x.x -v
Maybe the command is wrong, that's not the correct syntax?

Related

Can not access weblogic console from a different machine

I am having trouble accessing the weblogic console from a different machine in the same network.
I installed weblogic on a server from a different machine by ssh. The weblogic is up and running, but now I can't access the console on a browser from my machine. Both machines are part of the same network.
I am able to SSH in to the server from my local machine. Ping also works on both machines using each other's IP address.
telnet gives me the following output:
am#Linux-Vostro-3250:~$ telnet 192.x.x.x 7002
Trying 192.x.x.x...
telnet: Unable to connect to remote host: No route to host
This is confusing me, because I am able to access the server using ssh.
I searched everywhere for a possible solution, but I could only find more problems.
In very simple language, how do I resolve this issue or what exactly may the cause be?
There was no firewall cinfigured in the server. I set up a firewall by following the instructions from this site "https://oracle-base.com/articles/linux/linux-firewall"
There are two GUI options but none of them worked for me so better stick to the CLI.
then, using the following command i granted access to my local machine from the server :
# Accept packets from specific host (x.x.x.x).
iptables -A INPUT -s x.x.x.x -j ACCEPT
Now i can access the Weblogic console from my x.x.x.x machine.

Remote access to web server on linux

I have access to a server running CentOS 6.7 on which I installed apache and configured the /etc/httpd/conf/httpd.conf file.
I can see the webpage if I ssh to the server and run
$ lynx http://192.99.x.x
but I would like to access it using a real browser. If I try to access it from my computer, it tells me that this webpage is unavailable and if I try to run firefox on the CentOS terminal, I get error: No Display specified.
Is there a way to see the webpage in a browser without port forwarding ?
Without port forwarding, you will need to setup X11 forwarding in SSH. This will allow you to open graphical applications remotely. Below is a link to configure X11 forwarding for SSH.
X11 Forwarding with SSH
CentOS 6 SSH Configuration

Accessing MongoDB from Windows & Mac Client Machines

I have MongoDB 3.2 installed on my Linux Red Hat server.
I am starting to access it and looking at the mongo Shell instructions.
For a Windows machine, the instructions want me to get to the command prompt and change dirs to the installation directory. The problem is, MongoDB is installed on my web server and not my local windows machine.
Question: does Mongo Shell apply to me then? How do I start using, connecting and accessing Mongo from my Windows and Mac machines?
[Note: I am a traditional MySQL / phpMyAdmin developer looking to advance to MongoDB]
Amendments:
(1) With the help of #AlexBlex I am progressing to trying to connect to my MongoDB on my server from Robomongo on my windows client. I get the following error when trying to setup my connection. I tried the address with just my server ip and with http://{my server ip}. Neither worked. See screen shot of error
(2) This is what I have in my current mongod.conf file:
#port=27017
bind_ip=127.0.0.1
(3) here is what my connection settings look like. Oddly, #AlexBlex's solution below shows an SSH tab on his Mac version. The Windows and Mac versions I just installed lacks that tab.
If you install MongoDB on your local machine, you can use the Mongo shell like below to connect to your remote server
mongo yourserver:27017/database
You will have to configure your Mongo server to allow remote connections. In order to achieve this you need to have the following line in your /etc/mongodb.conf file. You need to replace 10.0.0.2 with the ip address of your client machine.
bind_ip = 127.0.0.1,10.0.0.2
You need either ssh to the server where mongodb is installed, or install mongodb on local machine.
For robomongo to connect to remote host you need to ssh to the server, and check it listens on external interface:
lsof -i | grep 27017
In case it is bound to localhost only, you need to edit a line with bind_ip in /etc/mongodb.conf and restart the service.
I would recommend to keep it listening on the local interface only for security reasons, and use ssh tunnelling to connect:
I found the answer. #ShahNewasKhan is brilliant. See How to connect Robomongo to MongoDB
All you need to do is SSH to server and edit mongod.conf file:
uncomment #port=27017 to port=27017
comment bind_ip=127.0.0.1 to #bind_ip=127.0.0.1
restart mongodb via service mongod restart
Then create a mongo connection via your server ip in the address field and 27017 in the port field
Hope this helps mongo newbies and start-ups like me :) Good luck.
Now I just need to figure out how to make this secure. My concern is that anyone who knows my server ip can hack into my MongoDB

Unable to connect to cloud9 over LAN

I've installed cloud 9 Ubuntu 14.04 (Desktop), and executed it by typing:
node [cloud9folder]/server.js -p 8080 -a :
I was able to connect to it by typing localhost:8080 (On the same computer that is running cloud 9) but when I went on another computer on the same network, I was unable to connect by typing [ip address of the computer running cloud9]:8080 into the browser. The browser returned: "Webpage not available (ERR_CONNECTION_REFUSED)."
I know the server computer is working, I was able to access it's apache2 website but for some reason it is unable to connect to cloud 9.
How do I fix this?
also add -l 0.0.0.0 by default server is listening on 127.0.0.1 which is not public

Linux to windows connection refused

I'm sure my lack of linux knowledge is what's causing this problem. I created a program in C# which uses QuickFix to do various things. I need this program to run on linux so I created an ubuntu virtual machine and recompiled the program with mono. The application starts ok but can't connect to my simulated exchange running on a windows machine. The error log returns Connection failed: Connection refused.
Could it be that I haven't setup linux properly?
Thanks
See if your VM can actually connect to that port (while the windows application is listening) with telnet:
telnet <ip> <port>
If telnet can't connect to the port, then you should probably check your VM network configuration, the interface configuration on ubuntu, and probably the firewall (both on windows and linux). Run ifconfig to see how your network is configured.

Resources