How do I enable an SSH server port in Raspian? (Raspberry Pi debian)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I'm going to set up a Raspberry Pi B+ without keyboard, mouse and screen. I'm only going to use PuTTy (MS-windows, ssh client) and an ethernet cable between my Raspberry Pi and my router.



Raspberry Pi's hard drive is a SD-card and on the SD-card there is a file named "cmdline". I open the file "cmdline" and added in "ip=192.168.1.2" to sett the IP address on the Raspberry Pi.



Tutorial:
https://youtu.be/Ioih6MHNNqc?t=1m1s



Then I wrote this command:



nmap -F 192.168.1.1-100


It scans all the IP adresses from 192.168.1.1 to 192.168.1.100



Then I found 192.168.1.2



Nmap scan report for 192.168.1.2
Host is up (0.0084s latency).
All 100 scanned ports on 192.168.1.2 are closed


But the ports are closed. How can I open ports? Can I do that in the file "cmdline"?







share|improve this question





















  • Where is this file cmdline?
    – ctrl-alt-delor
    Jul 10 at 22:09










  • It's on the boot folder at the SD-card of the Raspberry Pi.
    – Daniel Mårtensson
    Jul 10 at 22:12






  • 2




    What actual problem are you trying to solve here? Opening a port is a means, not an end.
    – Philip Kendall
    Jul 10 at 22:12










  • If you see the video I attached, you can see that I trying to get connection to my Raspberry Pi without using any screen, mouse or keyboard. Only PuTTy. I can sett the adress on my Raspberry Pi, but still, I cannot connect it.
    – Daniel Mårtensson
    Jul 10 at 22:14










  • You may be able to tell you router, to always give the same IP address to the PI (static IP). Else you can install avahi on the PI, and then use avahi/bonjor/zeroconf or what ever it is called on a MS-windows PC. to discover the IP address. Also consider setting up public/private key and disabling password login.
    – ctrl-alt-delor
    Jul 10 at 23:09














up vote
2
down vote

favorite












I'm going to set up a Raspberry Pi B+ without keyboard, mouse and screen. I'm only going to use PuTTy (MS-windows, ssh client) and an ethernet cable between my Raspberry Pi and my router.



Raspberry Pi's hard drive is a SD-card and on the SD-card there is a file named "cmdline". I open the file "cmdline" and added in "ip=192.168.1.2" to sett the IP address on the Raspberry Pi.



Tutorial:
https://youtu.be/Ioih6MHNNqc?t=1m1s



Then I wrote this command:



nmap -F 192.168.1.1-100


It scans all the IP adresses from 192.168.1.1 to 192.168.1.100



Then I found 192.168.1.2



Nmap scan report for 192.168.1.2
Host is up (0.0084s latency).
All 100 scanned ports on 192.168.1.2 are closed


But the ports are closed. How can I open ports? Can I do that in the file "cmdline"?







share|improve this question





















  • Where is this file cmdline?
    – ctrl-alt-delor
    Jul 10 at 22:09










  • It's on the boot folder at the SD-card of the Raspberry Pi.
    – Daniel Mårtensson
    Jul 10 at 22:12






  • 2




    What actual problem are you trying to solve here? Opening a port is a means, not an end.
    – Philip Kendall
    Jul 10 at 22:12










  • If you see the video I attached, you can see that I trying to get connection to my Raspberry Pi without using any screen, mouse or keyboard. Only PuTTy. I can sett the adress on my Raspberry Pi, but still, I cannot connect it.
    – Daniel Mårtensson
    Jul 10 at 22:14










  • You may be able to tell you router, to always give the same IP address to the PI (static IP). Else you can install avahi on the PI, and then use avahi/bonjor/zeroconf or what ever it is called on a MS-windows PC. to discover the IP address. Also consider setting up public/private key and disabling password login.
    – ctrl-alt-delor
    Jul 10 at 23:09












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I'm going to set up a Raspberry Pi B+ without keyboard, mouse and screen. I'm only going to use PuTTy (MS-windows, ssh client) and an ethernet cable between my Raspberry Pi and my router.



Raspberry Pi's hard drive is a SD-card and on the SD-card there is a file named "cmdline". I open the file "cmdline" and added in "ip=192.168.1.2" to sett the IP address on the Raspberry Pi.



Tutorial:
https://youtu.be/Ioih6MHNNqc?t=1m1s



Then I wrote this command:



nmap -F 192.168.1.1-100


It scans all the IP adresses from 192.168.1.1 to 192.168.1.100



Then I found 192.168.1.2



Nmap scan report for 192.168.1.2
Host is up (0.0084s latency).
All 100 scanned ports on 192.168.1.2 are closed


But the ports are closed. How can I open ports? Can I do that in the file "cmdline"?







share|improve this question













I'm going to set up a Raspberry Pi B+ without keyboard, mouse and screen. I'm only going to use PuTTy (MS-windows, ssh client) and an ethernet cable between my Raspberry Pi and my router.



Raspberry Pi's hard drive is a SD-card and on the SD-card there is a file named "cmdline". I open the file "cmdline" and added in "ip=192.168.1.2" to sett the IP address on the Raspberry Pi.



Tutorial:
https://youtu.be/Ioih6MHNNqc?t=1m1s



Then I wrote this command:



nmap -F 192.168.1.1-100


It scans all the IP adresses from 192.168.1.1 to 192.168.1.100



Then I found 192.168.1.2



Nmap scan report for 192.168.1.2
Host is up (0.0084s latency).
All 100 scanned ports on 192.168.1.2 are closed


But the ports are closed. How can I open ports? Can I do that in the file "cmdline"?









share|improve this question












share|improve this question




share|improve this question








edited Jul 10 at 22:34









DopeGhoti

39.7k54779




39.7k54779









asked Jul 10 at 20:27









Daniel MÃ¥rtensson

1445




1445











  • Where is this file cmdline?
    – ctrl-alt-delor
    Jul 10 at 22:09










  • It's on the boot folder at the SD-card of the Raspberry Pi.
    – Daniel Mårtensson
    Jul 10 at 22:12






  • 2




    What actual problem are you trying to solve here? Opening a port is a means, not an end.
    – Philip Kendall
    Jul 10 at 22:12










  • If you see the video I attached, you can see that I trying to get connection to my Raspberry Pi without using any screen, mouse or keyboard. Only PuTTy. I can sett the adress on my Raspberry Pi, but still, I cannot connect it.
    – Daniel Mårtensson
    Jul 10 at 22:14










  • You may be able to tell you router, to always give the same IP address to the PI (static IP). Else you can install avahi on the PI, and then use avahi/bonjor/zeroconf or what ever it is called on a MS-windows PC. to discover the IP address. Also consider setting up public/private key and disabling password login.
    – ctrl-alt-delor
    Jul 10 at 23:09
















  • Where is this file cmdline?
    – ctrl-alt-delor
    Jul 10 at 22:09










  • It's on the boot folder at the SD-card of the Raspberry Pi.
    – Daniel Mårtensson
    Jul 10 at 22:12






  • 2




    What actual problem are you trying to solve here? Opening a port is a means, not an end.
    – Philip Kendall
    Jul 10 at 22:12










  • If you see the video I attached, you can see that I trying to get connection to my Raspberry Pi without using any screen, mouse or keyboard. Only PuTTy. I can sett the adress on my Raspberry Pi, but still, I cannot connect it.
    – Daniel Mårtensson
    Jul 10 at 22:14










  • You may be able to tell you router, to always give the same IP address to the PI (static IP). Else you can install avahi on the PI, and then use avahi/bonjor/zeroconf or what ever it is called on a MS-windows PC. to discover the IP address. Also consider setting up public/private key and disabling password login.
    – ctrl-alt-delor
    Jul 10 at 23:09















Where is this file cmdline?
– ctrl-alt-delor
Jul 10 at 22:09




Where is this file cmdline?
– ctrl-alt-delor
Jul 10 at 22:09












It's on the boot folder at the SD-card of the Raspberry Pi.
– Daniel Mårtensson
Jul 10 at 22:12




It's on the boot folder at the SD-card of the Raspberry Pi.
– Daniel Mårtensson
Jul 10 at 22:12




2




2




What actual problem are you trying to solve here? Opening a port is a means, not an end.
– Philip Kendall
Jul 10 at 22:12




What actual problem are you trying to solve here? Opening a port is a means, not an end.
– Philip Kendall
Jul 10 at 22:12












If you see the video I attached, you can see that I trying to get connection to my Raspberry Pi without using any screen, mouse or keyboard. Only PuTTy. I can sett the adress on my Raspberry Pi, but still, I cannot connect it.
– Daniel Mårtensson
Jul 10 at 22:14




If you see the video I attached, you can see that I trying to get connection to my Raspberry Pi without using any screen, mouse or keyboard. Only PuTTy. I can sett the adress on my Raspberry Pi, but still, I cannot connect it.
– Daniel Mårtensson
Jul 10 at 22:14












You may be able to tell you router, to always give the same IP address to the PI (static IP). Else you can install avahi on the PI, and then use avahi/bonjor/zeroconf or what ever it is called on a MS-windows PC. to discover the IP address. Also consider setting up public/private key and disabling password login.
– ctrl-alt-delor
Jul 10 at 23:09




You may be able to tell you router, to always give the same IP address to the PI (static IP). Else you can install avahi on the PI, and then use avahi/bonjor/zeroconf or what ever it is called on a MS-windows PC. to discover the IP address. Also consider setting up public/private key and disabling password login.
– ctrl-alt-delor
Jul 10 at 23:09










4 Answers
4






active

oldest

votes

















up vote
3
down vote













I found the answer now!



Just add a empty file named "ssh" with no extenstion such as .txt or .c. Only "ssh" in the boot folder and rootfs folder of the SD card for the Raspberry Pi.



Then go to your router and find what IP the raspberry pi is set at.



enter image description here






share|improve this answer

















  • 2




    This is actually funny, raspberrypi.org/documentation/remote-access/ssh the ssh server is disabled by default.
    – Ezwig
    Jul 10 at 23:08






  • 2




    Well done ☺. Happy Gnu/Linuxing. You now have the same OS, as all 500 of the top 500 super computers (and about 60% of the web, but not this site), and …
    – ctrl-alt-delor
    Jul 10 at 23:18

















up vote
3
down vote













In bash type sudo apt-get install openssh-server



This will install the ssh server, it will listen on port 22, port 22 will become open. For what you have said you are trying to do, you do not need any other ports open.



To do this, you can not remote login, because ssh is the remote login tool. Therefore, do one of these.



  • When you setup noobs, tell it to install ssh-server (that would be another question). According to https://raspberrypi.stackexchange.com/q/59429/17370 you need to add a file named ssh to the boot directory, by removing SD card, and using another machine (do read this other question).

  • Connect SD card to another Unix box, and use it to install ssh-server (that would be another question).

  • Connect a monitor and keyboard to the pi (temporarily), and type the command.


Also nmap only scanned 100 ports, there are many more than that
( 2¹⁶ = 65536 ). So tell nmap to scan them all (it will be slower).






share|improve this answer























  • But that need to be already installed onto raspberry pi. I still cannot contact my Raspberry Pi via PuTTy.
    – Daniel Mårtensson
    Jul 10 at 22:08










  • No you install it, because it is not installed. If ssh-sever is not installed then you can not putty to it. I will add some choices.
    – ctrl-alt-delor
    Jul 10 at 22:21










  • Ok! I sett the IP adress on my rasp to 192.168.1.5 and check if my rasp is avaiable "nmap -F 192.168.1.1-100" and the results was: Nmap scan report for 192.168.1.5 Host is up (0.011s latency). All 100 scanned ports on 192.168.1.5 are closed
    – Daniel Mårtensson
    Jul 10 at 22:24










  • I try to connect my rasp now via Putty. Cannot connect it via 192.168.1.5
    – Daniel Mårtensson
    Jul 10 at 22:25










  • Why did you change its address? And You need ssh-server running on the Pi.
    – ctrl-alt-delor
    Jul 10 at 22:26

















up vote
2
down vote













You "open" a port simply by having a program listening for incoming connections on that port:



$ nc -l 12345


Poof! Port 12345 is now open and listening for incoming connections because nc is waiting for one.



A port being "closed" doesn't mean it's locked down; it simply means that there's nothing there listening for an incoming connection request.



If your question is more specifically about connecting via secure shell and not just generically establishing a connection to an arbitrary port, you need to install and start a secure shell server:



# apt install openssh-server
# service sshd start





share|improve this answer























  • nc: Permission denied When I try it. Super user won't work neither.
    – Daniel Mårtensson
    Jul 10 at 20:48










  • You should only get Permission denied if trying to open a port below 1000 as a non-superuser.
    – DopeGhoti
    Jul 10 at 20:57










  • Did not work for my Raspberry Pi. I still got Nmap scan report for 192.168.1.2 Host is up (0.0099s latency). All 100 scanned ports on 192.168.1.2 are closed
    – Daniel Mårtensson
    Jul 10 at 21:05






  • 1




    That would happen, only root can connect < 1000. nc may not be what you want, what are you trying to do?
    – ctrl-alt-delor
    Jul 10 at 22:18






  • 1




    @DanielMÃ¥rtensson OK, again - select a port that is greater than 1000, something like nc -l 1234 and with nmap specify a particular port nmap -p 1234 192.168.1.1 or a range nmap -p 1-2000 192.168.1.1. I may be mistaken but nmap may be defaulting to ports below 1000, and you need to specify range above that
    – Sergiy Kolodyazhnyy
    Jul 10 at 22:25

















up vote
2
down vote













first you need to install openssh-server on the pi.



1- plug your keyboard and your screen into it



2- boot it and open a terminal



3- download and install openssh-server deb package



 $ apt-get install openssh-server


4- enable and start sshd



 $ systemctl enable sshd
$ systemctl start sshd


now you ll be able to ssh into the pi






share|improve this answer





















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f454563%2fhow-do-i-enable-an-ssh-server-port-in-raspian-raspberry-pi-debian%23new-answer', 'question_page');

    );

    Post as a guest






























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    I found the answer now!



    Just add a empty file named "ssh" with no extenstion such as .txt or .c. Only "ssh" in the boot folder and rootfs folder of the SD card for the Raspberry Pi.



    Then go to your router and find what IP the raspberry pi is set at.



    enter image description here






    share|improve this answer

















    • 2




      This is actually funny, raspberrypi.org/documentation/remote-access/ssh the ssh server is disabled by default.
      – Ezwig
      Jul 10 at 23:08






    • 2




      Well done ☺. Happy Gnu/Linuxing. You now have the same OS, as all 500 of the top 500 super computers (and about 60% of the web, but not this site), and …
      – ctrl-alt-delor
      Jul 10 at 23:18














    up vote
    3
    down vote













    I found the answer now!



    Just add a empty file named "ssh" with no extenstion such as .txt or .c. Only "ssh" in the boot folder and rootfs folder of the SD card for the Raspberry Pi.



    Then go to your router and find what IP the raspberry pi is set at.



    enter image description here






    share|improve this answer

















    • 2




      This is actually funny, raspberrypi.org/documentation/remote-access/ssh the ssh server is disabled by default.
      – Ezwig
      Jul 10 at 23:08






    • 2




      Well done ☺. Happy Gnu/Linuxing. You now have the same OS, as all 500 of the top 500 super computers (and about 60% of the web, but not this site), and …
      – ctrl-alt-delor
      Jul 10 at 23:18












    up vote
    3
    down vote










    up vote
    3
    down vote









    I found the answer now!



    Just add a empty file named "ssh" with no extenstion such as .txt or .c. Only "ssh" in the boot folder and rootfs folder of the SD card for the Raspberry Pi.



    Then go to your router and find what IP the raspberry pi is set at.



    enter image description here






    share|improve this answer













    I found the answer now!



    Just add a empty file named "ssh" with no extenstion such as .txt or .c. Only "ssh" in the boot folder and rootfs folder of the SD card for the Raspberry Pi.



    Then go to your router and find what IP the raspberry pi is set at.



    enter image description here







    share|improve this answer













    share|improve this answer



    share|improve this answer











    answered Jul 10 at 23:01









    Daniel MÃ¥rtensson

    1445




    1445







    • 2




      This is actually funny, raspberrypi.org/documentation/remote-access/ssh the ssh server is disabled by default.
      – Ezwig
      Jul 10 at 23:08






    • 2




      Well done ☺. Happy Gnu/Linuxing. You now have the same OS, as all 500 of the top 500 super computers (and about 60% of the web, but not this site), and …
      – ctrl-alt-delor
      Jul 10 at 23:18












    • 2




      This is actually funny, raspberrypi.org/documentation/remote-access/ssh the ssh server is disabled by default.
      – Ezwig
      Jul 10 at 23:08






    • 2




      Well done ☺. Happy Gnu/Linuxing. You now have the same OS, as all 500 of the top 500 super computers (and about 60% of the web, but not this site), and …
      – ctrl-alt-delor
      Jul 10 at 23:18







    2




    2




    This is actually funny, raspberrypi.org/documentation/remote-access/ssh the ssh server is disabled by default.
    – Ezwig
    Jul 10 at 23:08




    This is actually funny, raspberrypi.org/documentation/remote-access/ssh the ssh server is disabled by default.
    – Ezwig
    Jul 10 at 23:08




    2




    2




    Well done ☺. Happy Gnu/Linuxing. You now have the same OS, as all 500 of the top 500 super computers (and about 60% of the web, but not this site), and …
    – ctrl-alt-delor
    Jul 10 at 23:18




    Well done ☺. Happy Gnu/Linuxing. You now have the same OS, as all 500 of the top 500 super computers (and about 60% of the web, but not this site), and …
    – ctrl-alt-delor
    Jul 10 at 23:18












    up vote
    3
    down vote













    In bash type sudo apt-get install openssh-server



    This will install the ssh server, it will listen on port 22, port 22 will become open. For what you have said you are trying to do, you do not need any other ports open.



    To do this, you can not remote login, because ssh is the remote login tool. Therefore, do one of these.



    • When you setup noobs, tell it to install ssh-server (that would be another question). According to https://raspberrypi.stackexchange.com/q/59429/17370 you need to add a file named ssh to the boot directory, by removing SD card, and using another machine (do read this other question).

    • Connect SD card to another Unix box, and use it to install ssh-server (that would be another question).

    • Connect a monitor and keyboard to the pi (temporarily), and type the command.


    Also nmap only scanned 100 ports, there are many more than that
    ( 2¹⁶ = 65536 ). So tell nmap to scan them all (it will be slower).






    share|improve this answer























    • But that need to be already installed onto raspberry pi. I still cannot contact my Raspberry Pi via PuTTy.
      – Daniel Mårtensson
      Jul 10 at 22:08










    • No you install it, because it is not installed. If ssh-sever is not installed then you can not putty to it. I will add some choices.
      – ctrl-alt-delor
      Jul 10 at 22:21










    • Ok! I sett the IP adress on my rasp to 192.168.1.5 and check if my rasp is avaiable "nmap -F 192.168.1.1-100" and the results was: Nmap scan report for 192.168.1.5 Host is up (0.011s latency). All 100 scanned ports on 192.168.1.5 are closed
      – Daniel Mårtensson
      Jul 10 at 22:24










    • I try to connect my rasp now via Putty. Cannot connect it via 192.168.1.5
      – Daniel Mårtensson
      Jul 10 at 22:25










    • Why did you change its address? And You need ssh-server running on the Pi.
      – ctrl-alt-delor
      Jul 10 at 22:26














    up vote
    3
    down vote













    In bash type sudo apt-get install openssh-server



    This will install the ssh server, it will listen on port 22, port 22 will become open. For what you have said you are trying to do, you do not need any other ports open.



    To do this, you can not remote login, because ssh is the remote login tool. Therefore, do one of these.



    • When you setup noobs, tell it to install ssh-server (that would be another question). According to https://raspberrypi.stackexchange.com/q/59429/17370 you need to add a file named ssh to the boot directory, by removing SD card, and using another machine (do read this other question).

    • Connect SD card to another Unix box, and use it to install ssh-server (that would be another question).

    • Connect a monitor and keyboard to the pi (temporarily), and type the command.


    Also nmap only scanned 100 ports, there are many more than that
    ( 2¹⁶ = 65536 ). So tell nmap to scan them all (it will be slower).






    share|improve this answer























    • But that need to be already installed onto raspberry pi. I still cannot contact my Raspberry Pi via PuTTy.
      – Daniel Mårtensson
      Jul 10 at 22:08










    • No you install it, because it is not installed. If ssh-sever is not installed then you can not putty to it. I will add some choices.
      – ctrl-alt-delor
      Jul 10 at 22:21










    • Ok! I sett the IP adress on my rasp to 192.168.1.5 and check if my rasp is avaiable "nmap -F 192.168.1.1-100" and the results was: Nmap scan report for 192.168.1.5 Host is up (0.011s latency). All 100 scanned ports on 192.168.1.5 are closed
      – Daniel Mårtensson
      Jul 10 at 22:24










    • I try to connect my rasp now via Putty. Cannot connect it via 192.168.1.5
      – Daniel Mårtensson
      Jul 10 at 22:25










    • Why did you change its address? And You need ssh-server running on the Pi.
      – ctrl-alt-delor
      Jul 10 at 22:26












    up vote
    3
    down vote










    up vote
    3
    down vote









    In bash type sudo apt-get install openssh-server



    This will install the ssh server, it will listen on port 22, port 22 will become open. For what you have said you are trying to do, you do not need any other ports open.



    To do this, you can not remote login, because ssh is the remote login tool. Therefore, do one of these.



    • When you setup noobs, tell it to install ssh-server (that would be another question). According to https://raspberrypi.stackexchange.com/q/59429/17370 you need to add a file named ssh to the boot directory, by removing SD card, and using another machine (do read this other question).

    • Connect SD card to another Unix box, and use it to install ssh-server (that would be another question).

    • Connect a monitor and keyboard to the pi (temporarily), and type the command.


    Also nmap only scanned 100 ports, there are many more than that
    ( 2¹⁶ = 65536 ). So tell nmap to scan them all (it will be slower).






    share|improve this answer















    In bash type sudo apt-get install openssh-server



    This will install the ssh server, it will listen on port 22, port 22 will become open. For what you have said you are trying to do, you do not need any other ports open.



    To do this, you can not remote login, because ssh is the remote login tool. Therefore, do one of these.



    • When you setup noobs, tell it to install ssh-server (that would be another question). According to https://raspberrypi.stackexchange.com/q/59429/17370 you need to add a file named ssh to the boot directory, by removing SD card, and using another machine (do read this other question).

    • Connect SD card to another Unix box, and use it to install ssh-server (that would be another question).

    • Connect a monitor and keyboard to the pi (temporarily), and type the command.


    Also nmap only scanned 100 ports, there are many more than that
    ( 2¹⁶ = 65536 ). So tell nmap to scan them all (it will be slower).







    share|improve this answer















    share|improve this answer



    share|improve this answer








    edited Jul 11 at 7:38


























    answered Jul 10 at 22:04









    ctrl-alt-delor

    8,64331946




    8,64331946











    • But that need to be already installed onto raspberry pi. I still cannot contact my Raspberry Pi via PuTTy.
      – Daniel Mårtensson
      Jul 10 at 22:08










    • No you install it, because it is not installed. If ssh-sever is not installed then you can not putty to it. I will add some choices.
      – ctrl-alt-delor
      Jul 10 at 22:21










    • Ok! I sett the IP adress on my rasp to 192.168.1.5 and check if my rasp is avaiable "nmap -F 192.168.1.1-100" and the results was: Nmap scan report for 192.168.1.5 Host is up (0.011s latency). All 100 scanned ports on 192.168.1.5 are closed
      – Daniel Mårtensson
      Jul 10 at 22:24










    • I try to connect my rasp now via Putty. Cannot connect it via 192.168.1.5
      – Daniel Mårtensson
      Jul 10 at 22:25










    • Why did you change its address? And You need ssh-server running on the Pi.
      – ctrl-alt-delor
      Jul 10 at 22:26
















    • But that need to be already installed onto raspberry pi. I still cannot contact my Raspberry Pi via PuTTy.
      – Daniel Mårtensson
      Jul 10 at 22:08










    • No you install it, because it is not installed. If ssh-sever is not installed then you can not putty to it. I will add some choices.
      – ctrl-alt-delor
      Jul 10 at 22:21










    • Ok! I sett the IP adress on my rasp to 192.168.1.5 and check if my rasp is avaiable "nmap -F 192.168.1.1-100" and the results was: Nmap scan report for 192.168.1.5 Host is up (0.011s latency). All 100 scanned ports on 192.168.1.5 are closed
      – Daniel Mårtensson
      Jul 10 at 22:24










    • I try to connect my rasp now via Putty. Cannot connect it via 192.168.1.5
      – Daniel Mårtensson
      Jul 10 at 22:25










    • Why did you change its address? And You need ssh-server running on the Pi.
      – ctrl-alt-delor
      Jul 10 at 22:26















    But that need to be already installed onto raspberry pi. I still cannot contact my Raspberry Pi via PuTTy.
    – Daniel Mårtensson
    Jul 10 at 22:08




    But that need to be already installed onto raspberry pi. I still cannot contact my Raspberry Pi via PuTTy.
    – Daniel Mårtensson
    Jul 10 at 22:08












    No you install it, because it is not installed. If ssh-sever is not installed then you can not putty to it. I will add some choices.
    – ctrl-alt-delor
    Jul 10 at 22:21




    No you install it, because it is not installed. If ssh-sever is not installed then you can not putty to it. I will add some choices.
    – ctrl-alt-delor
    Jul 10 at 22:21












    Ok! I sett the IP adress on my rasp to 192.168.1.5 and check if my rasp is avaiable "nmap -F 192.168.1.1-100" and the results was: Nmap scan report for 192.168.1.5 Host is up (0.011s latency). All 100 scanned ports on 192.168.1.5 are closed
    – Daniel Mårtensson
    Jul 10 at 22:24




    Ok! I sett the IP adress on my rasp to 192.168.1.5 and check if my rasp is avaiable "nmap -F 192.168.1.1-100" and the results was: Nmap scan report for 192.168.1.5 Host is up (0.011s latency). All 100 scanned ports on 192.168.1.5 are closed
    – Daniel Mårtensson
    Jul 10 at 22:24












    I try to connect my rasp now via Putty. Cannot connect it via 192.168.1.5
    – Daniel Mårtensson
    Jul 10 at 22:25




    I try to connect my rasp now via Putty. Cannot connect it via 192.168.1.5
    – Daniel Mårtensson
    Jul 10 at 22:25












    Why did you change its address? And You need ssh-server running on the Pi.
    – ctrl-alt-delor
    Jul 10 at 22:26




    Why did you change its address? And You need ssh-server running on the Pi.
    – ctrl-alt-delor
    Jul 10 at 22:26










    up vote
    2
    down vote













    You "open" a port simply by having a program listening for incoming connections on that port:



    $ nc -l 12345


    Poof! Port 12345 is now open and listening for incoming connections because nc is waiting for one.



    A port being "closed" doesn't mean it's locked down; it simply means that there's nothing there listening for an incoming connection request.



    If your question is more specifically about connecting via secure shell and not just generically establishing a connection to an arbitrary port, you need to install and start a secure shell server:



    # apt install openssh-server
    # service sshd start





    share|improve this answer























    • nc: Permission denied When I try it. Super user won't work neither.
      – Daniel Mårtensson
      Jul 10 at 20:48










    • You should only get Permission denied if trying to open a port below 1000 as a non-superuser.
      – DopeGhoti
      Jul 10 at 20:57










    • Did not work for my Raspberry Pi. I still got Nmap scan report for 192.168.1.2 Host is up (0.0099s latency). All 100 scanned ports on 192.168.1.2 are closed
      – Daniel Mårtensson
      Jul 10 at 21:05






    • 1




      That would happen, only root can connect < 1000. nc may not be what you want, what are you trying to do?
      – ctrl-alt-delor
      Jul 10 at 22:18






    • 1




      @DanielMÃ¥rtensson OK, again - select a port that is greater than 1000, something like nc -l 1234 and with nmap specify a particular port nmap -p 1234 192.168.1.1 or a range nmap -p 1-2000 192.168.1.1. I may be mistaken but nmap may be defaulting to ports below 1000, and you need to specify range above that
      – Sergiy Kolodyazhnyy
      Jul 10 at 22:25














    up vote
    2
    down vote













    You "open" a port simply by having a program listening for incoming connections on that port:



    $ nc -l 12345


    Poof! Port 12345 is now open and listening for incoming connections because nc is waiting for one.



    A port being "closed" doesn't mean it's locked down; it simply means that there's nothing there listening for an incoming connection request.



    If your question is more specifically about connecting via secure shell and not just generically establishing a connection to an arbitrary port, you need to install and start a secure shell server:



    # apt install openssh-server
    # service sshd start





    share|improve this answer























    • nc: Permission denied When I try it. Super user won't work neither.
      – Daniel Mårtensson
      Jul 10 at 20:48










    • You should only get Permission denied if trying to open a port below 1000 as a non-superuser.
      – DopeGhoti
      Jul 10 at 20:57










    • Did not work for my Raspberry Pi. I still got Nmap scan report for 192.168.1.2 Host is up (0.0099s latency). All 100 scanned ports on 192.168.1.2 are closed
      – Daniel Mårtensson
      Jul 10 at 21:05






    • 1




      That would happen, only root can connect < 1000. nc may not be what you want, what are you trying to do?
      – ctrl-alt-delor
      Jul 10 at 22:18






    • 1




      @DanielMÃ¥rtensson OK, again - select a port that is greater than 1000, something like nc -l 1234 and with nmap specify a particular port nmap -p 1234 192.168.1.1 or a range nmap -p 1-2000 192.168.1.1. I may be mistaken but nmap may be defaulting to ports below 1000, and you need to specify range above that
      – Sergiy Kolodyazhnyy
      Jul 10 at 22:25












    up vote
    2
    down vote










    up vote
    2
    down vote









    You "open" a port simply by having a program listening for incoming connections on that port:



    $ nc -l 12345


    Poof! Port 12345 is now open and listening for incoming connections because nc is waiting for one.



    A port being "closed" doesn't mean it's locked down; it simply means that there's nothing there listening for an incoming connection request.



    If your question is more specifically about connecting via secure shell and not just generically establishing a connection to an arbitrary port, you need to install and start a secure shell server:



    # apt install openssh-server
    # service sshd start





    share|improve this answer















    You "open" a port simply by having a program listening for incoming connections on that port:



    $ nc -l 12345


    Poof! Port 12345 is now open and listening for incoming connections because nc is waiting for one.



    A port being "closed" doesn't mean it's locked down; it simply means that there's nothing there listening for an incoming connection request.



    If your question is more specifically about connecting via secure shell and not just generically establishing a connection to an arbitrary port, you need to install and start a secure shell server:



    # apt install openssh-server
    # service sshd start






    share|improve this answer















    share|improve this answer



    share|improve this answer








    edited Jul 10 at 22:31


























    answered Jul 10 at 20:30









    DopeGhoti

    39.7k54779




    39.7k54779











    • nc: Permission denied When I try it. Super user won't work neither.
      – Daniel Mårtensson
      Jul 10 at 20:48










    • You should only get Permission denied if trying to open a port below 1000 as a non-superuser.
      – DopeGhoti
      Jul 10 at 20:57










    • Did not work for my Raspberry Pi. I still got Nmap scan report for 192.168.1.2 Host is up (0.0099s latency). All 100 scanned ports on 192.168.1.2 are closed
      – Daniel Mårtensson
      Jul 10 at 21:05






    • 1




      That would happen, only root can connect < 1000. nc may not be what you want, what are you trying to do?
      – ctrl-alt-delor
      Jul 10 at 22:18






    • 1




      @DanielMÃ¥rtensson OK, again - select a port that is greater than 1000, something like nc -l 1234 and with nmap specify a particular port nmap -p 1234 192.168.1.1 or a range nmap -p 1-2000 192.168.1.1. I may be mistaken but nmap may be defaulting to ports below 1000, and you need to specify range above that
      – Sergiy Kolodyazhnyy
      Jul 10 at 22:25
















    • nc: Permission denied When I try it. Super user won't work neither.
      – Daniel Mårtensson
      Jul 10 at 20:48










    • You should only get Permission denied if trying to open a port below 1000 as a non-superuser.
      – DopeGhoti
      Jul 10 at 20:57










    • Did not work for my Raspberry Pi. I still got Nmap scan report for 192.168.1.2 Host is up (0.0099s latency). All 100 scanned ports on 192.168.1.2 are closed
      – Daniel Mårtensson
      Jul 10 at 21:05






    • 1




      That would happen, only root can connect < 1000. nc may not be what you want, what are you trying to do?
      – ctrl-alt-delor
      Jul 10 at 22:18






    • 1




      @DanielMÃ¥rtensson OK, again - select a port that is greater than 1000, something like nc -l 1234 and with nmap specify a particular port nmap -p 1234 192.168.1.1 or a range nmap -p 1-2000 192.168.1.1. I may be mistaken but nmap may be defaulting to ports below 1000, and you need to specify range above that
      – Sergiy Kolodyazhnyy
      Jul 10 at 22:25















    nc: Permission denied When I try it. Super user won't work neither.
    – Daniel Mårtensson
    Jul 10 at 20:48




    nc: Permission denied When I try it. Super user won't work neither.
    – Daniel Mårtensson
    Jul 10 at 20:48












    You should only get Permission denied if trying to open a port below 1000 as a non-superuser.
    – DopeGhoti
    Jul 10 at 20:57




    You should only get Permission denied if trying to open a port below 1000 as a non-superuser.
    – DopeGhoti
    Jul 10 at 20:57












    Did not work for my Raspberry Pi. I still got Nmap scan report for 192.168.1.2 Host is up (0.0099s latency). All 100 scanned ports on 192.168.1.2 are closed
    – Daniel Mårtensson
    Jul 10 at 21:05




    Did not work for my Raspberry Pi. I still got Nmap scan report for 192.168.1.2 Host is up (0.0099s latency). All 100 scanned ports on 192.168.1.2 are closed
    – Daniel Mårtensson
    Jul 10 at 21:05




    1




    1




    That would happen, only root can connect < 1000. nc may not be what you want, what are you trying to do?
    – ctrl-alt-delor
    Jul 10 at 22:18




    That would happen, only root can connect < 1000. nc may not be what you want, what are you trying to do?
    – ctrl-alt-delor
    Jul 10 at 22:18




    1




    1




    @DanielMÃ¥rtensson OK, again - select a port that is greater than 1000, something like nc -l 1234 and with nmap specify a particular port nmap -p 1234 192.168.1.1 or a range nmap -p 1-2000 192.168.1.1. I may be mistaken but nmap may be defaulting to ports below 1000, and you need to specify range above that
    – Sergiy Kolodyazhnyy
    Jul 10 at 22:25




    @DanielMÃ¥rtensson OK, again - select a port that is greater than 1000, something like nc -l 1234 and with nmap specify a particular port nmap -p 1234 192.168.1.1 or a range nmap -p 1-2000 192.168.1.1. I may be mistaken but nmap may be defaulting to ports below 1000, and you need to specify range above that
    – Sergiy Kolodyazhnyy
    Jul 10 at 22:25










    up vote
    2
    down vote













    first you need to install openssh-server on the pi.



    1- plug your keyboard and your screen into it



    2- boot it and open a terminal



    3- download and install openssh-server deb package



     $ apt-get install openssh-server


    4- enable and start sshd



     $ systemctl enable sshd
    $ systemctl start sshd


    now you ll be able to ssh into the pi






    share|improve this answer

























      up vote
      2
      down vote













      first you need to install openssh-server on the pi.



      1- plug your keyboard and your screen into it



      2- boot it and open a terminal



      3- download and install openssh-server deb package



       $ apt-get install openssh-server


      4- enable and start sshd



       $ systemctl enable sshd
      $ systemctl start sshd


      now you ll be able to ssh into the pi






      share|improve this answer























        up vote
        2
        down vote










        up vote
        2
        down vote









        first you need to install openssh-server on the pi.



        1- plug your keyboard and your screen into it



        2- boot it and open a terminal



        3- download and install openssh-server deb package



         $ apt-get install openssh-server


        4- enable and start sshd



         $ systemctl enable sshd
        $ systemctl start sshd


        now you ll be able to ssh into the pi






        share|improve this answer













        first you need to install openssh-server on the pi.



        1- plug your keyboard and your screen into it



        2- boot it and open a terminal



        3- download and install openssh-server deb package



         $ apt-get install openssh-server


        4- enable and start sshd



         $ systemctl enable sshd
        $ systemctl start sshd


        now you ll be able to ssh into the pi







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered Jul 10 at 22:51









        Ezwig

        320212




        320212






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f454563%2fhow-do-i-enable-an-ssh-server-port-in-raspian-raspberry-pi-debian%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?