Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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 have installed virtualbox and I am running ubuntu 16.04-2 64 bit as a virtual machine.
I can ping the server with IP address 192.168.124.10
But now I want to log on to the server using SSH.
The openssh-server package is installed but when I try to log on I get the message: ssh: connect to host 192.168.124.10 port 22: Connection refused
My wifi network is configured to use DHCP and my wifi adapter gets an IP address of 192.168.124.x
I tried to set a static IP address but when I configure it that way I don't have access to the internet.
I have googled and configured SSH to use port 2222 but this doesn't help.
I also made a rule for ufw to accept connections on port 22
Lets take it from the top.
When you first created the VM, how was it congfigured? Was it NAT, bridged, Host only adapter? Are you able to ping anything from inside the VM? What does the ONBOOT (yes, no) say in /etc/sysconfig/network-scripts/ifcfg-enp0s3 or eth0?
How did you go about configuring ssh exactly? Did you use gui interfaces or the command line? I believe UBuntu 16 is systemd. if so, you can check the server is running via
Code:
systemctl status sshd
you should get something like
Code:
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: disable
Active: active (running) since Sun 2017-07-23 06:51:50 PDT; 2 days ago
Main PID: 871 (sshd)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/ssh.service
└─871 /usr/sbin/sshd -D
lines 1-7/7 (END)
note the bolded text.
Also check your configuration file
Code:
your-favorite-text-editor /etc/ssh/sshd_config
and make sure the "Port" reads 2222, as you said you have set it. Though if you're paranoid enough I'd recommend changing this to something else and not post the port number online, and also make sure your firewall rule allows the same port that you're changing it to. Then reload the service
Code:
systemctl restart sshd
Note that most of these commands require root privileges.
Last edited by TheEzekielProject; 07-25-2017 at 09:08 PM.
Thank you all for your help.
The situation is as follows: I am on a wifi network of 192.168.124.x this is my only network.
I have configured the virtual machine's NIC as a bridged adapter which is attached to wl0
I have checked the Cable connected radio button.
From the virtual machine I can ping the host for example ping 192.168.124.75
From my linux Mint terminal I can ping 192.168.124.10 (this is the ip address I gave ubuntu server)
Promiscuous mode is set to allow all
From giving the command systemctl status sshd I found that the server was listening on port 0.0.0.0 strange enough.
So I edited /etc/ssh/sshd_config
There I set the ip address to 192.168.124.10
Now I can log on using SSH but the connection seems to be somewhat unstable.
Sometimes the link is broken.
But I think this is what I have to be satisfied with.
I prefer to use VirtualBox instead of VMware because VirtulBox is open source.
I configured the whole thing and I can log on to my server but much to often I get something like:
cannot connect to port 22 connection refused (I don't know the exact output)
What I did is install VMware player again, on one virtual machine I run pfSense profiding NAT and many other features.
I then assigned an extra IP address to my wifi adapter.
I now have a virtual network isolated from th rest which I can access from my Mint terminal.
VirtualBox can a thing or two from the ease of which everything is installed and it's stabilaty.
But maybe the problem isn't VirtualBox but me . . .
But for now I'm happy with the current configuration despite of the fact that VMware isn't open source.
Thank you all for your time and effort.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.