ssh: connect to host localhost port 2222: Connection refused [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I installed Virtual Box on my Linux OS, in the Virtual Box, I created another Linux OS, which has a user called "dvader", I want to SSH from my local Linux OS to the Linux OS on Virtual Box, I used the command below:
$ ssh -p 2222 dvader#localhost
But I always got the error:
ssh: connect to host localhost port 2222: Connection refused
Anyone knows how to solve this problem? Thank you in advance.

cuestion: ¿are you using NAT?... SSH listen p22 by default, if you want connection on p2222 edit the ssh_config placed in /etc/ of your VM Guest... find the line (assuming that you are in a *buntu OS family)
39 # Port 22
and change it to
39 Port 2222
and there you have it on p2222
BTW, your host could'nt see the guest by name "dvader#localhost", because "localhost" it's indeed your HOST & your GUEST maybe another IP, give more details about your VNetwork config...
Sorry for my english :)

Related

How to configure localhost on Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 4 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I'm trying to set up a virtual machine with CentOS 7 to use it as an Oracle Database Server (I'm new to Linux). I have encountered a problem about the host configuration that as I was reading has to be configured previously.
You see, this is where I collide with my knowledge that I have in windows. I thought it was enough to change the device name like this:
[root#localhost.localdomain ~] # hostname SERVER01
[root#localhost.localdomain ~] # hostname
SERVER01
[root # SERVER01 ~] #
And I do not understand why from windows I can not ping the Linux machine only using its hostname (SERVER01)
The ping request could not find host SERVER01. Check the name and
try again.
I understand that the previous configuration of the host in CentOS 7 that I am asked to install the database server has to do with the fact that I can not ping it using SERVER01. Although I have to clarify that using the IP if I can.
What do I do to make that change in Linux and can ping only using the hostname as it happens in windows?
When you change the hostname in linux you are essentially just telling the OS "this is your name".
In order to reflect that on the network mapping as well, you need to edit the hosts file:
nano /etc/hosts
or if you are a vi fan:
vi /etc/hosts
Note that you will need root access to do this.
In that file you can just extend the localhost mapping to also include your custom hostname SERVER01
127.0.0.1 localhost.localdomain localhost SERVER01
Once you do this, from the same CentOS terminal you can type ping SERVER01 and it should give you a proper ping results.
If you want to be able to ping and access the services on that virtual machine from your Windows OS, then you will need to do the same mapping through the hosts file on your Windows, but this time you will have to use the IP provided to the vm, instead of 127.0.0.1.

How to connect to a Linux (Debian) VM from the host (Windows 7) using VNC? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have a Debian 8 VM using Virtualbox running on a Windows 7.
I've installed TightVNC server on my Debian vm, and UltraVNC on my Windows 7 host, but every ip I try (with the port 5901) returns a "failed to connect to server".
How do I find the correct ip address of the VM in order to connect to its vnc server from the host machine? Is there any other configuration needed?
You can enter into the configuration of the GUEST host.
In configuration / Screen / Remote Screen
check the enable checkbox. (take care of port number)
Then, you only need to open a RDC client (just the Remote access of windows), Put the IP of the HOST machine (and the port like 10.10.10.10:3389) and you are connected fron Anywhere to the Guest machine.
if you need to use VNC, then you need to bridge the tap (ethernet) or need to bypass the port to the machine to reach it from the network.
If you need to connect only with VNC from HOST to GUEST, just read the IP of the ethernet interface of the GUEST, and just connect to this IP From the HOST PC.
You can type in a console IP ADDR to get the IP of the Debian GUEST.

SSH local port forward can not access from outside [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
After
server-a$ ssh -L 9000:imgur.com:80 user#example.com
I can only
server-a$ telnet 127.0.0.1 9000
from the server-a, can not access 9000 port of server-a from outside.
How can I access the server-a 9000 from outside, I don't have any iptables ?
PS: I meet this problem before, after I edit the sshd_config, this problem was fixed, but I don't remember what I changed.
Add -g to the command
ssh -g -L 9000:imgur.com:80 user#example.com
From ssh man:
-g Allows remote hosts to connect to local forwarded ports.
means ssh will listen on other IP then localhost enabling you to connect to the forwarded port from outside your system.
This is not on by default because it can be a security issue (random people connecting to the forwarded port arriving on the supposedly secured destination server)

Getting connection refused while executing scp connection in amazon ec2 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 6 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I want to copy my file from local machine to remote machine in amazon ec2. I am executing following command:
scp -i ilmkey.pem shahjahan.txt ubuntu#ec2-52-25-74-139.us-west-2.compute.amazonaws.com:~
I am getting following error:
ssh: connect to host ec2-52-25-74-139.us-west-2.compute.amazonaws.com
port 22: Connection refused lost connection
The command telnet HOSTNAME 22 gives:
telnet: could not resolve HOSTNAME/22: Name or service not known
I have set
SSH TCP 22
0.0.0.0/0
in security group tab. Please help me to solve this.
A "connection refused" error makes me think that sshd is not running or that the machine failed to boot. If the Security Group was rejecting you, the question would time out instead. If this instance was already running and SSH was working before, reboot the machine from the console and see if SSH comes back up when it reboots. Also look at the logs via the AWS console, and if you still can't get anywhere, contact AWS Support.

Connection refused on SVN checkout attempt [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am using Linux on VMWare Workstation inside windows 7 and i want to access to the URL below in terminal but i always get this error back. I am totally sure that everything is correct because my friend has tried the same on his computer and it worked. Please advise me something about it .It is very important
svn co svn://svn.alunos.di.uminho.pt/projectname --username __ --password __
svn: E000111: Unable to connect to a repository at URL 'svn://svn.alunos.di.uminho.pt/__'
svn: E000111: Can't connect to host 'svn.alunos.di.uminho.pt': Connection refused
The problem is that the IP address of the VM is being blocked from connecting somehow. It could be being blocked by the server, or an intermediate firewall (because it doesn't recognise the IP address, or because you are using some network like a guest network or wifi, that blocks certain ports or hosts) or it could be that there is no route from the VM to the server.
Basically I would say it's an IT Helpdesk issue; however, if the Helpdesk does not support VMware, or does not support Linux, or does not support connecting to that server, then you will have to ask someone else.

Resources