LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 10-02-2016, 04:01 PM   #1
hamza javaid
LQ Newbie
 
Registered: Oct 2016
Posts: 1

Rep: Reputation: Disabled
Unhappy SSH Connection


Hi there, i'm a new user of linux. i have installed virtual box on my linux machine. Now i want to set an SSH connection between both of the Machines. when i try to connect my system with virtual box machine with SSH, it does not connect and the following error comes always.
ssh: connect to host ####### port 22: Connection timed out.
Any one here to help me?
 
Old 10-02-2016, 05:50 PM   #2
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
Hi and WELCOME to LQ! I faced the same problem. One easy solution is to add a 2nd *bridged* network.
here (1st, poweroff guest; in Network, Adapter 2, Enable as bridged; default Name ok)
or this

Best wishes! Enjoy... (when you mark this "Solved", post exactly how, to help others!)

p.s.
Also, (esp. if you had included virtualbox in your title, and maybe host to guest)
check the "Similar Threads" at the *bottom* of (all!) posts here.

There's also the "Newbie" forum. (maybe include details like 'distro')

web-searches returned lots of other ways (many obscure/confusing),
so picking the 'right' keywords is the 'secret/trick/key'

Last edited by Jjanel; 10-02-2016 at 06:36 PM.
 
Old 10-02-2016, 06:59 PM   #3
end
Member
 
Registered: Aug 2016
Posts: 266

Rep: Reputation: Disabled
re

can you ping virtual machine.

put this on virtual machine

#allow ssh
iptables -A INPUT -i enp2s0 -p tcp -s 192.168.0.12 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o enp2s0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT

-s - change this to your ip from which you connecting
and change enp2s0 to your virtual machine adapter

ifconfig or ip addr to see network adapters on linux
 
Old 10-03-2016, 04:23 AM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,442
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
SSH Connection

The default settings of virtualbox include using NAT. This will not allow you to do what you're trying to do. You need to change the network adapter type to Bridged while the VM is powered off, so that the VM can get an ip address from your router. You should then be able to ssh in, as long as sshd is running on the guest. Beware that some default configurations disallow root logins.
 
  


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] ssh question - keep transfer going after quitting ssh connection iamk2 Linux - Networking 2 11-28-2014 07:10 AM
ssh: connection to host port: 22: Connection timed out lost connection cucolin@ Linux - Server 4 11-22-2011 06:15 AM
ssh connection forces password change, then closes connection loadedmind Linux - Newbie 2 02-16-2011 01:24 PM
LXer: ssh-xfer: Quickly grabbing files over an existing SSH connection LXer Syndicated Linux News 0 08-08-2008 03:11 PM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM

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

All times are GMT -5. The time now is 09:26 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