[SOLVED] can't telnet to my guest computer in virtualbox
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
# 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 ::
#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
# 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
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.