Link to home
Start Free TrialLog in
Avatar of chalie001
chalie001

asked on

not able to connect to vm

hi am not able to connect to my via ftp but i can ping my vm am using winscp my vm is in linux ubuntu my host is window 10
User generated image
Avatar of Farzad Akbarnejad
Farzad Akbarnejad
Flag of Iran, Islamic Republic of image

Hi,
Maybe the ftp service in your VM is down. You or your Admin must login to your server on vm and start service.

-FA
Avatar of chalie001
chalie001

ASKER

ok how to start ther ftp service
FTP is a two part service, 21 authentication and then the FTP server either connects back or if your system is behind a firewall, a PASV mode which means the FTP service has to have a range of ports opened as well.

FTP service runs under IIS, login and see whether the FTP site is running.

Is this a new setup or you were able to FTP before and unable to do so now?
# systemctl start vsftpd
# systemctl enable vsftpd
or maybe FTP is not installed!

Why would you want to use FTP, when you can use WinSCP ?
Am getting error when using WinSCP
The point Andrew makes, transfer using scp (ssh) type connection.
Forget about FTP / TELNET / RSH ...  those protocols break any form of security you may have.

Use SSH.   If you can logon to your system with SSH (using putty, reflection etc.)  then you can either use scp or sftp protocol / tools.
WINScp should also be able to do sftp or scp.

(sftp != ftps...  sftp uses an ssh tunnel to a system to handle a simplyfied ftp alike protocol, ftps is FTP using SSL the latter cannot pass firewall reliably, if it CAN pass a firewall, then again security is broken or the firewall is not doing its work in the majority cases).
SSH is just bloat - FTP is fine.
The ftp server is usually started on-demand by inetd. You need to have an ftp server installed, then insert it in /etc/inetd.conf. 2 examples:
1. For vsftpd
ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  vsftpd

Open in new window

2. For proftpd
ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  proftpd

Open in new window

While ssh has a header/resource overhead FTP is a plain text ....and has a more complicated configuration/setup firewall ports related.
User generated image  i did this
and it fails ?

can you ssh to the same server using Putty ?

can you ping the VM ?
If it is vsftp then in WinSCP you must use the FTP protocol and configure  encryption in  advanced  settings   SSL / TLS conection.

Remember that vsftpd is an FTP over SSL / TLS and the SFTP is SSH FTP.  you  are trying  to connect using Secure SHell FTP  to a server that expects SSL FTP (conection refusef)
am geting this
User generated image
check whether you are applying a deny /etc/hosts.allow /etc/hosts.deny for sshd.

confirm that the software firewall on the system allows the traffic.
I can connect to other vm only this vm giving issue
The arnold comment is specific for your VM. Please ask your admin to login it by console and check two above fules for permission.

-FA.
two above files.
The same way you have to check whether you can access a location by checking the door, the same is true about VMs. Because you have access to one, does not mean that you have access to another.
These are virtual Machines and might not be identically setup for access.

Based on your error, if it comes up as soon as you make the attempt, the message is "connection refused" This means you were denied entry/access.
it may eliminate the firewall but worth while checking just in the event the port was redirected to the wrong destination.
Best to check versus think it is as it should be and then discover after running down all other rabbit holes, that the issue was the firewall miss-configuration.
i have this User generated image
look awhether youhave ALL:ALL or sshd:ALL in the hosts.deny and then check whether your IP is in the hosts.allow with
SSHD:yourcomputersLANIP.

allow supersedes denied entries.

this type of setting allows for the admin to control from which systems this system can be accessed via SSH or via other tcpwrapper aware applications.

The restriction can also be setup on the firewall to explicitly define source from which the service can be accessed.
How do I check in firewall
Which Linux distribution it varies between iptables, sfw, firewalld

Another run lsof -I:22 to see if you have a service running and listening on port 22.
hi am in ubuntu User generated imageUser generated image
The command is lsof no t.

You need to look as sfw to make sure access to ssh is permitted

You are not applying allow/deny restriction on the service level hosts.allow and hosts.deny are empty.
Ihere is a guide that might help you get around ..https://linoxide.com/firewall/guide-ufw-firewall-ubuntu-16-10/
i did thisUser generated image
Did this meaning, what?

What are you showing a picture of?
This looks like /etc/services
Could you attach the /etc/ssh/sshd.conf  or sshd_conf?
you mean this
/etc/ssh$ cat ssh_config

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   IdentityFile ~/.ssh/id_ecdsa
#   IdentityFile ~/.ssh/id_ed25519
#   Port 22
#   Protocol 2
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no
No, this is a client config, they want sshd_config for the server config.
They are looking whether additional settings, I.e bind port ....

To test ssh functionality while logged in to the system, run
ssh <username>@localhost
To confirm ssh server is running and working.

IMHO, the issue is whether ssh is allowed in.
i run this from the server
Not sure what the answer means.

The suggestion is to test to make sure the service s running and working by eliminating all possible variables.
One while in the VM console, ssh to self
If this test fails, the issue is on the ssh service server.
If it. Works in localhost, second attempt is to the LAN Ip.
If that works, the issue is with the software firewall.
If that is verified.
The issue with network and potential firewall hardware...
From inside test out.
when i do ssh am having this
ssh: connect to host localhost port 22: Connection refused

am geting this also
ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=38.7 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=48.2 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=54 time=46.9 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=54 time=38.5 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=54 time=43.9 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=54 time=42.2 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=54 time=28.2 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=54 time=39.4 ms
64 bytes from 8.8.8.8: icmp_seq=9 ttl=54 time=45.0 ms
64 bytes from 8.8.8.8: icmp_seq=10 ttl=54 time=44.4 ms
64 bytes from 8.8.8.8: icmp_seq=11 ttl=54 time=17.9 ms
64 bytes from 8.8.8.8: icmp_seq=12 ttl=54 time=41.4 ms
64 bytes from 8.8.8.8: icmp_seq=13 ttl=54 time=39.6 ms
64 bytes from 8.8.8.8: icmp_seq=14 ttl=54 time=47.3 ms
^C
--- 8.8.8.8 ping statistics ---
14 packets transmitted, 14 received, 0% packet loss, time 13019ms
rtt min/avg/max/mdev = 17.974/40.165/48.256/7.864 ms
Is means your ssh service is not running
service sshd start
Then see if you can connect from the workstation ...
Then check the setup to make sure the sshd service starts at boot.
am geting this service sshd start
Failed to start sshd.service: Unit sshd.service not found.
service ssh start
Or try
/usr/sbin/sshd &
i did this
service ssh start
Failed to start ssh.service: Unit ssh.service not found.
username@myubuntu:~$ service /usr/sbin/sshd &
[1] 23623
username@myubuntu:~$ /usr/sbin/sshd: unrecognized service
Mno service,
Just run
/usr/sbin/sshd &
i got this
User generated image
Please confirm you have ssh server installed and configured to run.
Use sfw to confirm you have opened port 22.
Try /sbin/sshd
Run aptitude, or apt-get install openssh-server

netstat -an | grep ":22"
Please, in VM terminal execute the following com
    mands:

    ip addr show

    netstat -lnpt | grep 22

    iptables -nvL INPUT

    sudo apt-get install openssh-server

    Send the results of each and finally capture  the network settings of the VirtualBox for the VM and attach it.
    This question needs an answer!
    Become an EE member today
    7 DAY FREE TRIAL
    Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
    View membership options
    or
    Learn why we charge membership fees
    We get it - no one likes a content blocker. Take one extra minute and find out why we block content.