How to ssh from windows to my ubuntu machine in the local network

12,598

I know this is an old question, but it came up sorta high up in the Google search, so, for anyone having troubles for SSH'ing from a Windows to a Linux box, in my case, the problem was that I hadn't installed the SSH server on my Linux Mint machine.

Even if you do have SSH installed (like for connecting to another computers), you need this package to enable receiving connections.

sudo apt-get install openssh-server
Share:
12,598

Related videos on Youtube

Pleerock
Author by

Pleerock

Typescript/Javascript backend (node.js) and frontend (angular) developer. Previously PHP (symfony) & Java (android) developer. Over 10 years in software development. Checkout my open source repositories on github.

Updated on September 18, 2022

Comments

  • Pleerock
    Pleerock over 1 year

    When I'm trying to ssh to my local ubuntu server from the gitbash on my windows machine Im getting this error:

    $ ssh 192.168.1.11
    ssh: connect to host 192.168.1.11 port 22: Bad file number
    

    Other answers I've found seems to be related to linux-to-linux connetions. I'm newbie here, can you please provide information how to achieve that?

    Running nmap -sS 192.168.1.11 -p 22:

    C:\Users\Me>nmap -sS 192.168.1.11 -p 22
    
    Starting Nmap 6.40 ( http://nmap.org )
    Nmap scan report for 192.168.1.11
    Host is up (0.0040s latency).
    PORT   STATE    SERVICE
    22/tcp filtered ssh
    MAC Address: 20:16:D8:3E:E0:30 (Liteon Technology)
    
    Nmap done: 1 IP address (1 host up) scanned in 13.70 seconds
    

    Running: ssh -v 192.168.1.11 -p 443:

    $ ssh -v 192.168.1.11 -p 443
    OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
    debug1: Reading configuration data /c/Users/Me/.ssh/config
    debug1: Applying options for 192.168.1.11
    debug1: Connecting to 192.168.1.11 [192.168.1.11] port 443.
    debug1: connect to address 192.168.1.11 port 443: Attempt to connect timed out w
    ithout establishing a connection
    ssh: connect to host 192.168.1.11 port 443: Bad file number
    

    And even if I edit my .ssh/config like this:

    Host ubuntu.dev
    Hostname 192.168.1.11
    User meubuntu
    

    And connecting to ssh ubuntu.dev It still does not work

    • Stormvirux
      Stormvirux about 10 years
      could you update the question with output of nmap -sS 192.168.1.11 -p 22 and nc -z 192.168.1.11 1-25 -v or just scan port 22 with any of the port scanners and update the question with the outout
  • Pleerock
    Pleerock about 10 years
    Ive already tried it, does not work. Turned off my antivirus and its firewall - still does not work. Maybe I need something to setup on my ubuntu machine?
  • aspdeepak
    aspdeepak about 8 years
    This helped me in setting up ssh connection between my windows 7 host and ubuntu guest.