LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-15-2020, 02:34 PM   #1
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Rep: Reputation: 18
can't telnet to my guest computer in virtualbox


Hi all-

I had a really hard time with ssh a while back. I thought today that I should see if I can telnet to guest machine on port 22.
I have a bridge only network adapter and a router (nighthawk) and fedora firewalld (firewall).

I can't telnet in. I am getting unable to telnet in. Connection refused.

The adapters are on the same network (private) one for vbox and one for the windows host (same IP range).

If I can't telnet I don't see how I can do ssh!

telnet ssh-server-ip 22

Please help!
thanks.

Last edited by mtdew3q; 11-15-2020 at 02:36 PM. Reason: forgot to list my telnet command
 
Old 11-15-2020, 02:47 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,732

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
telnet would be on port 25, if running at all. It a completely different protocol than ssh. It wouldn’t be available on port 22.
If sshd is running on the server, you should be able to
Code:
ssh server-ip
did you try that?
 
1 members found this post helpful.
Old 11-15-2020, 02:56 PM   #3
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Original Poster
Rep: Reputation: 18
Hi -

Thanks for the tip about not being able to use telnet.

$ ssh server-ip
ssh: connect to host server-ip port 22: Connection refused

I never can get through. Only when I run ssh on the same host!

thanks,
robo-loki
 
Old 11-15-2020, 03:15 PM   #4
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Original Poster
Rep: Reputation: 18
Hi all-

Here is my sshd_config file:

Thanks for any help!

robo-loki

I am trying to do password connect with ssh from cygwin:

# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.

# To modify the system-wide sshd configuration, create a *.conf file under
# /etc/ssh/sshd_config.d/ which will be automatically included below
Include /etc/ssh/sshd_config.d/*.conf

# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
Port 22
AddressFamily inet
ListenAddress serverip
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
StrictModes no
MaxAuthTries 30
#MaxSessions 10

PubkeyAuthentication no

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
# AuthorizedKeysFile .ssh/authorized_keys

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
#KerberosUseKuserok yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
#GSSAPIEnablek5users no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
# WARNING: 'UsePAM no' is not supported in Fedora and may cause several
# problems.
UsePAM yes

#AllowAgentForwarding yes
AllowTcpForwarding yes
GatewayPorts yes
X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
PermitTTY yes
PrintMotd yes
PrintLastLog yes
TCPKeepAlive no
#PermitUserEnvironment no
#Compression delayed
ClientAliveInterval 60
#ClientAliveCountMax 3
UseDNS no
PidFile /var/run/sshd.pid
MaxStartups 10:30:100
PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
Banner /etc/ssh/banner

# override default of no subsystems
# Subsystem sftp /usr/libexec/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
 
Old 11-15-2020, 03:16 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,732

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
You need to dig into the server ssh configuration …
Is sshd running? Is it listening on port 22? (Use netstat or ss to check)
Is the firewall configured to allow connections on port 22?

When you don’t specify a user with the ssh command, it tries to connect as the remote user...does that user exist on the server?

Use the -v option to increase the verbosity if the connection...up to 3 times. Again; man ssh
 
Old 11-15-2020, 03:20 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,732

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Please use code tags when posting output...see the link in my sig
 
1 members found this post helpful.
Old 11-15-2020, 03:56 PM   #7
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by mtdew3q View Post
Hi -

Thanks for the tip about not being able to use telnet.

$ ssh server-ip
ssh: connect to host server-ip port 22: Connection refused

I never can get through. Only when I run ssh on the same host!

thanks,
robo-loki
On the server/host you are connecting to you need to make certain sshd is running so your client has an active server to make the connection.

You also need to make sure the firewall on that machine allows ssh connections to port 22.
 
1 members found this post helpful.
Old 11-15-2020, 04:15 PM   #8
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Original Poster
Rep: Reputation: 18
HI all-

I really appreciate the help.

There is something blocking me that isn't the usual problem. I tried all those steps.
ad-infinitum .

Have a cool night before back to the grind.

later all.

Thnx :-)
 
Old 11-15-2020, 06:36 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,732

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
Quote:
I have a bridge only network adapter and a router (nighthawk) and fedora firewalld (firewall).

The adapters are on the same network (private) one for vbox and one for the windows host (same IP range).
There is no bridge only network adapter, There is bridged and host only.

Bridged network adapter configures the VM to be on your LAN just like any other network device. The IP address assuming Fedora is using DHCP will be assigned by your router(Nighthawk).

Host only network adapter allows guests to talk to each and the host but not to the outside world i.e. your LAN.

By the way the default network adapter is NAT which works like a simple router. Outside i.e your LAN can not talk directly to your VM but the VM can talk to your LAN and the internet.

Since you can connect to ssh on the VM itself it looks like a network or possibly firewall issue. I have the latest Fedora running as a VirtualBox guest on a CentOS 7 system. I had to initially start ssh manually but the default firewall does allow traffic. My virtual adapter network is configured as bridged.

Go back and confirm how the network adapter is configured and that you are using the correct IP addresses. Post the exact commands you are running. Since LAN addresses are not routeable and in general 192.168.x.x is very common for private IP addresses you can post yours without fear of revealing personal information.

The telnet command as you posted used to be a quick way to check TCP network connections but it isn't very good especially for binary only connections. nmap, nc, hping are a few good tools and lots of information and examples can be easily found.

Last edited by michaelk; 11-15-2020 at 06:41 PM.
 
1 members found this post helpful.
Old 11-15-2020, 06:55 PM   #10
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Original Poster
Rep: Reputation: 18
Hi Michaelk-

I disabled the internet for host-only network manager applet interface and port forwarded with the NAT adapter like this:

Quote:
rule 1 hostip port guestip port
127.0.0.1 4205 10.0.2.15 22

I can connect with ssh user@127.0.0.1 -p 4205.
This person put out a great guide:

https://medium.com/nycdev/how-to-ssh...e-6cb4c91acc2e

It prompted me for the key, so anything else that goes wrong is key related at this point. I am taking a break.

Sorry for getting so stuck!

thanks,
robo-loki
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can't mount shared folder - Virtualbox - Ubuntu 18 Guest OS - With Guest Addition swilsy Linux - Virtualization and Cloud 6 12-24-2018 06:54 PM
4MLinux as VirtualBox guest - how can I install VirtualBox Guest Additions? wghay 4MLinux 11 09-30-2018 12:17 PM
Guest to Host message passing - guest's memory usage statistics & guest's IP address Prince_Pangeni Linux - Virtualization and Cloud 2 03-03-2012 03:06 AM
problem installing guest additions in Fedora 11 guest (virtualbox) mia_tech Linux - Desktop 9 07-28-2009 12:15 AM
Virtualbox Gentoo Guest - Can't get guest additions working MALDATA Gentoo 3 06-18-2009 11:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration