How do I enable an SSH server port in Raspian? (Raspberry Pi debian)
Clash 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"?
ssh raspberry-pi raspbian
add a comment |Â
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"?
ssh raspberry-pi raspbian
Where is this filecmdline
?
â 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
add a comment |Â
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"?
ssh raspberry-pi raspbian
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"?
ssh raspberry-pi raspbian
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 filecmdline
?
â 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
add a comment |Â
Where is this filecmdline
?
â 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
add a comment |Â
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.
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
add a comment |Â
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).
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
 |Â
show 2 more comments
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
nc: Permission denied When I try it. Super user won't work neither.
â Daniel MÃ¥rtensson
Jul 10 at 20:48
You should only getPermission 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 likenc -l 1234
and withnmap
specify a particular portnmap -p 1234 192.168.1.1
or a rangenmap -p 1-2000 192.168.1.1
. I may be mistaken butnmap
may be defaulting to ports below 1000, and you need to specify range above that
â Sergiy Kolodyazhnyy
Jul 10 at 22:25
 |Â
show 15 more comments
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
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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.
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
add a comment |Â
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
add a comment |Â
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).
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
 |Â
show 2 more comments
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).
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
 |Â
show 2 more comments
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).
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).
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
 |Â
show 2 more comments
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
 |Â
show 2 more comments
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
nc: Permission denied When I try it. Super user won't work neither.
â Daniel MÃ¥rtensson
Jul 10 at 20:48
You should only getPermission 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 likenc -l 1234
and withnmap
specify a particular portnmap -p 1234 192.168.1.1
or a rangenmap -p 1-2000 192.168.1.1
. I may be mistaken butnmap
may be defaulting to ports below 1000, and you need to specify range above that
â Sergiy Kolodyazhnyy
Jul 10 at 22:25
 |Â
show 15 more comments
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
nc: Permission denied When I try it. Super user won't work neither.
â Daniel MÃ¥rtensson
Jul 10 at 20:48
You should only getPermission 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 likenc -l 1234
and withnmap
specify a particular portnmap -p 1234 192.168.1.1
or a rangenmap -p 1-2000 192.168.1.1
. I may be mistaken butnmap
may be defaulting to ports below 1000, and you need to specify range above that
â Sergiy Kolodyazhnyy
Jul 10 at 22:25
 |Â
show 15 more comments
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
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
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 getPermission 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 likenc -l 1234
and withnmap
specify a particular portnmap -p 1234 192.168.1.1
or a rangenmap -p 1-2000 192.168.1.1
. I may be mistaken butnmap
may be defaulting to ports below 1000, and you need to specify range above that
â Sergiy Kolodyazhnyy
Jul 10 at 22:25
 |Â
show 15 more comments
nc: Permission denied When I try it. Super user won't work neither.
â Daniel MÃ¥rtensson
Jul 10 at 20:48
You should only getPermission 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 likenc -l 1234
and withnmap
specify a particular portnmap -p 1234 192.168.1.1
or a rangenmap -p 1-2000 192.168.1.1
. I may be mistaken butnmap
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
 |Â
show 15 more comments
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
add a comment |Â
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
add a comment |Â
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
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
answered Jul 10 at 22:51
Ezwig
320212
320212
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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