Can't make SSH or Telnet connections

Started by jondx, August 30, 2013, 06:13:49 PM

Previous topic - Next topic

jondx

I am unable to connect via SSH or Telnet to my server or other nodes on my network. I am able to connect to the host running Backbox, however. I've flushed out all the filtering- I disabled firewall and flushed iptables. ssh is running and listening on port 22. I can't track down the problem.

weVeg

#1
Hi jondx, try to explain your network configuration,  are you on same network or do you try to connect over the internet?  do you have a psw or cert? your router port are opened and forward the conn? Your server accept connections from your host? try to paste the command that you use to connect to your server, and paste your log please!
una voce libera è sempre liberatrice
under_r00t

jondx



Sure thing. I am trying to make internal network connections. My server is running Ubuntu Server hosted in a virtual box. The network type is bridged. I have also tried with NAT and port forwarding, but have been unable to make a ssh tunnel from the host to the vm. I am using this simple ssh command in terminal:

ssh xx.xx.xx.xx -l <user> 

I am able to make a reverse tunnel as I already said. I can connect from the VM to the host. So the connectivity and network settings are set correctly, I assume. I haven't forwarded a port in my router. I didn't think that would be necessary. Please, what log would you like to?

b4d_bl0ck

Hi jondx,
yes, it's not necessary: as long as you stay in the same subnet, router doesn't matter...
Anyways i'm still trying to understand your network configuration. Ok, you have an Ubuntu server you want to connect to, running in a virtual machine on a PC... So you have an OS hosting an Ubuntu guest, and that's almost sure.
Now, BackBox is on a different PC, or it's another virtual guest on the same machine? What do you mean with "host"? The BackBox system? Are you trying to access the server from a different physical machine? Please, specify in detail the topology of your physical and virtual devices.

Also try to post the output of:
ssh -v <your_username>@<ssh_server>

Have fun!
bool secure = check_paranoia() ? true : false;

weVeg

Hi jondx,
if you are on the same subnet try (from your host)
ssh <user>@<ssh_server>

I was thinking, on your server sshd is started??  Try to paste even this log (from your server):
cat /var/log/auth.log | grep ssh
una voce libera è sempre liberatrice
under_r00t

sinflooddotnet

#5
can you ping your gateway on both machines? maybe it's a basic IP networking issue like ip addr, netmask, ec
check out (on server and client)
$ifconfig | grep 'inet addr'
$sudo netstat -rn


iptables check (on server and client)
$sudo iptables -L
should contain nothing on the client or at least outgoing tcp/22, tcp|udp/53, ICMP 0+8, etc. at least the server should allow incoming ssh connections (tcp/22) and also ICMP 0+8 (icmp for testing layer 3 connectivity ). can you ping it?

sshd check/restart (on server)
$sudo netstat -launtp | grep sshd
$sudo ps aux | grep sshd

is it there, does it listen on your correct IP? does it listen on a port you configured like the usual tcp/22?
if not running, run
$sudo /etc/init.d/sshd restart
(will start if not running, check netstat again)

and check ubuntu forums too! this is most likely not a BB issue

good luck!

sinflooddotnet

if all is looking fine and still not working, check out your configuration of the SSH daemon first and then the client

server
$cat /etc/ssh/sshd_config
client
$cat /etc/ssh/ssh_config

check out these manpages:
http://manpages.ubuntu.com/manpages/precise/en/man5/sshd_config.5.html
http://manpages.ubuntu.com/manpages/hardy/man5/ssh_config.5.html

maybe you used /etc/hosts.allow ?
if so, check out this link for usage: http://linuxservertutorials.blogspot.nl/2008/11/ubuntu-hostsallow.html

ostendali

Quote from: jondx on August 31, 2013, 01:08:09 AM


Sure thing. I am trying to make internal network connections. My server is running Ubuntu Server hosted in a virtual box. The network type is bridged. I have also tried with NAT and port forwarding, but have been unable to make a ssh tunnel from the host to the vm. I am using this simple ssh command in terminal:

ssh xx.xx.xx.xx -l <user> 

I am able to make a reverse tunnel as I already said. I can connect from the VM to the host. So the connectivity and network settings are set correctly, I assume. I haven't forwarded a port in my router. I didn't think that would be necessary. Please, what log would you like to?
just type "service iptables stop" on both side and see what happens.
It is quite easy to mess up with the iptables, so make sure that there is no fw that hanging the connection.

If you can connect from VM to the host you don't need any port forwarding configuration on your router. Do as I said and also run -vvv option when you ssh (as somebody already suggested), that will tell you what exactly is the, if not it will give the input.