Author Topic: Can't make SSH or Telnet connections  (Read 7260 times)

jondx

  • Newbie
  • *
  • Posts: 2
    • View Profile
on: August 30, 2013, 05:13:49 PM
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

  • Hero Member
  • *****
  • Posts: 737
    • View Profile
Reply #1 on: August 30, 2013, 05:30:36 PM
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!
« Last Edit: August 30, 2013, 09:27:24 PM by weVeg »

una voce libera è sempre liberatrice
under_r00t


jondx

  • Newbie
  • *
  • Posts: 2
    • View Profile
Reply #2 on: August 31, 2013, 12: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?



b4d_bl0ck

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Reply #3 on: August 31, 2013, 11:29:56 AM
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:
Code: [Select]
ssh -v <your_username>@<ssh_server>
Have fun!

bool secure = check_paranoia() ? true : false;


weVeg

  • Hero Member
  • *****
  • Posts: 737
    • View Profile
Reply #4 on: August 31, 2013, 01:45:01 PM
Hi jondx,
if you are on the same subnet try (from your host)
Code: [Select]
ssh <user>@<ssh_server>
I was thinking, on your server sshd is started??  Try to paste even this log (from your server):
Code: [Select]
cat /var/log/auth.log | grep ssh

una voce libera è sempre liberatrice
under_r00t


sinflooddotnet

  • Newbie
  • *
  • Posts: 40
    • View Profile
Reply #5 on: September 01, 2013, 10:15:03 AM
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)
Code: [Select]
$ifconfig | grep 'inet addr'
$sudo netstat -rn

iptables check (on server and client)
Code: [Select]
$sudo iptables -Lshould 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)
Code: [Select]
$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
Code: [Select]
$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!
« Last Edit: September 01, 2013, 10:21:50 AM by sinflooddotnet »



sinflooddotnet

  • Newbie
  • *
  • Posts: 40
    • View Profile
Reply #6 on: September 01, 2013, 10:57:14 AM
if all is looking fine and still not working, check out your configuration of the SSH daemon first and then the client

server
Code: [Select]
$cat /etc/ssh/sshd_configclient
Code: [Select]
$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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 587
    • View Profile
Reply #7 on: September 07, 2013, 01:51:48 PM


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.