ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Raspberry PI SSH with Windows 10 and ubuntu

Sun Dec 25, 2016 4:19 pm

Hello guys,

I have Raspberry pi Model 3 B. I have tried a lot to do ssh with my laptop which has both Ubuntu and Windows 10. Nothing works!!

I have burned Raspbian Jassie with Pixel on my SD card with Win 32 utility. After that I created ssh file which has nothing on it. (To enable ssh)

I use Putty and Openssh. In windows it tells me after I enter the IP of RPI that Network error connection refused. I have also created passwd file as per the guidelines.

In ubuntu it tells me after Access denied. I login as pi and use raspberry as password. I have already updated the sshd_config file.

ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Re: Raspberry PI SSH with Windows 10 and ubuntu

Sun Dec 25, 2016 7:02 pm

Also I would like to add that I can ping my PI from prompt..

User avatar
HawaiianPi
Posts: 5507
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry PI SSH with Windows 10 and ubuntu

Sun Dec 25, 2016 8:21 pm

ujjwalrathod007 wrote:...After that I created ssh file which has nothing on it. (To enable ssh)...
Did you create that file in Windows? Because Windows defaults to hiding common file extensions, and you may have created a file called "ssh.txt" without realizing it.

Look at the card in Linux (Ubuntu) and make sure it is just "ssh" for the filename.

In the next release ssh.txt will be accepted as well to fix that annoying Windows flaw.
ujjwalrathod007 wrote:...
I have also created passwd file as per the guidelines.
I have already updated the sshd_config file.
Not sure what "guidelines" you are referring to, but neither of those should be needed. You just need the "ssh" file.

Also, if you powered the Pi down without a proper shutdown, then you'll need to re-image the card and start over. An improper shutdown before SSH has been established breaks the functionality.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

leiptrstormr
Posts: 60
Joined: Mon May 18, 2015 12:33 pm

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 5:34 am

Sshd should be on by default in Raspbian. Is your Raspberry Pi wired or wireless? If wireless, you'll need to do some post installation setup on the Raspberry Pi before you can log in through ssh.

User avatar
HawaiianPi
Posts: 5507
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 7:38 am

leiptrstormr wrote:Sshd should be on by default in Raspbian. Is your Raspberry Pi wired or wireless? If wireless, you'll need to do some post installation setup on the Raspberry Pi before you can log in through ssh.
Not any longer. As of the 2016-11-25 release SSH is disabled by default.
http://downloads.raspberrypi.org/raspbi ... _notes.txt
https://www.raspberrypi.org/blog/a-secu ... ian-pixel/
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 2:53 pm

I have purchased a new PI and after that I have burned the image file several times as ssh was not working. The ssh.text is not hidden I have checked.

How long it takes to install the os on PI usually?
Is it like the full install is complete we can ssh?

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 3:17 pm

ujjwalrathod007 wrote:I have purchased a new PI and after that I have burned the image file several times as ssh was not working. The ssh.text is not hidden I have checked.

How long it takes to install the os on PI usually?
Is it like the full install is complete we can ssh?
It should be named as "ssh". The pitfall here is that Windows usually hide file extension, so when you see "ssh", it could be "ssh.txt". I was told that newer image would accept both "ssh" and "ssh.txt".

"ssh.text" won't work.

ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 3:36 pm

Then what should I do? Create .pdf?? :lol: :lol:

It will always show extension..

User avatar
DougieLawson
Posts: 38543
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 3:50 pm

Assuming your SDCard appears as drive F: when you insert it. Then open a cmd.exe window
echo "" > f:\ssh
exit


Safely remove the SDCard and it will come up with ssh active.

If you're using NOOBS you'll have to find some other way.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
HawaiianPi
Posts: 5507
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 4:38 pm

allfox wrote:It should be named as "ssh". The pitfall here is that Windows usually hide file extension, so when you see "ssh", it could be "ssh.txt". I was told that newer image would accept both "ssh" and "ssh.txt".
There is no newer image yet. The fix has been pushed to apt, but the 2016-11-25 image does not have the fix, so we will have to wait for an even newer image.
ujjwalrathod007 wrote:Then what should I do? Create .pdf?? :lol: :lol:

It will always show extension..
A file extension is not required. It's just that Windows hides common file extensions by default. This is not only an inconvenience, it's a security risk. It's a vector for malicious hackers to infect computers by passing around executable files that are supposed to be pictures, videos, word documents, etc. You don't see the .exe extension because Windows hides it, so you end up running a virus installer when you think you are going to watch a video.

Personally, that's one of the first settings in Windows I change when reinstalling or setting up a new computer.

In Windows 10, type file extensions in the Cortana/search field and you should see Show or hide file extensions in the results. Uncheck the option to Hide extensions for known file types.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 7:39 pm

Actually nothing worked for me till now...
Can I do ssh in other OS images? like Ubuntu, ROS etc??

Also if .exe is hidden when I download a software it always shows me .exe file what about that?

tweak42
Posts: 531
Joined: Tue Mar 22, 2016 3:16 am
Location: Los Angeles, California

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 8:37 pm

ujjwalrathod007 wrote:Actually nothing worked for me till now...
Can I do ssh in other OS images? like Ubuntu, ROS etc??

Also if .exe is hidden when I download a software it always shows me .exe file what about that?
Ssh server is often not installed in other os images, or disabled by default. You would have to login locally and install it manually, or enable it. If they are enabled by default they will probably start disabling it in new releases, as many distros take their lead from raspbian.

If .exe is on the windows hidden extensions and is still showing, then it's could be some other extension masquerading as an executable attempting to trick you into running it for nefarious purposes. Hence it's safer to disable hidden windows file extensions all together.

As to why you cannot enable your ssh server, have you tried simply running sudo raspi-config, changing your password and enabling ssh server from there? Since you are having difficulty with the ssh file on the boot partition, why just enable it the old easy way to be sure?

ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 10:16 pm

Where Should I enter sudo raspi-config? in SSH command prompt or normal?
After I enter the IP of R-PI in Putty I get the error connection refused.

ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 10:47 pm

As I said In Windows it tells me "Network error connection refused" after that the window will be inactivated.
In Ubuntu it will ask for username and password.
I enter pi and raspberry. then it says access denied..

User avatar
DougieLawson
Posts: 38543
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry PI SSH with Windows 10 and ubuntu

Mon Dec 26, 2016 10:52 pm

Connection refused means nothing is listening on the port you're attempting to connect to.

There's three possible reasons for that
1. Wrong IP address
2. ssh not running
3. ssh listening on some port other than 22
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
HawaiianPi
Posts: 5507
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry PI SSH with Windows 10 and ubuntu

Tue Dec 27, 2016 1:58 am

ujjwalrathod007 wrote:Actually nothing worked for me till now...
Then you are doing something wrong. It works for me and many others.

Describe your procedure in detail, step by step, including any errors, restarts, etc. Include the info below, and anything else you can think of that might be helpful.

1. Where did you download the image?
2. Did you verify the SHA-1 hash?
3. How did you extract the .img file from the .zip archive?
4. How did you write the image to the card?
5. Did you safely eject the card and re-insert it before writing the "ssh" file?
6. How did you create the "ssh" file?
7. Do you have "Hide extensions for known file types" disabled in Windows (assuming you used Windows to image the card)?
8. Is the "ssh" file still in /boot after you have started the Pi and attempted to use SSH?
9. Is your Raspberry Pi connected to your router with an Ethernet cable? If not, please describe your setup in detail.
10. Is your Pi on the same network as your other computers (not on a "guest" or external/remote network)?

The two biggest issues with the current release is that the file must be named ssh (not ssh.txt, .pdf, or any other file extension), and you must not improperly shutdown the Pi while attempting to get SSH working (if you do you must re-image the card and start over).

You can't do this with your Pi connected directly to another computer's Ethernet port without some additional prep.

You can't do this on a Wireless network (WiFi) without including a properly configured wpa_supplicant.conf file in /boot as well.

That's all I can think of at the moment...

FYI: This is what works for me. I have tested this on both my Pi3 (built-in WiFi) and Pi-Zero (with a USB WiFi dongle).

1. Download the 2016-11-25 Raspbian image from: https://www.raspberrypi.org/downloads/raspbian/
2. Verify the SHA-1 hash (checksum) with sha1sum in Linux, or the HashCheck shell extension in Windows.
3. Extract the .img file with WinRAR (currently using version 5.40, 64-bit). 7-Zip should work as well.
4. Write the image to the card using Etcher (I have also used Win32DiskImager).
5. Eject and re-insert the card to flush the write buffer and insure Windows isn't caching old data (Etcher automatically ejects the card).
6. Open a window to the SD card (boot) and right-click > New > Text Document, then name it ssh (making sure to delete the .txt extension).

Since I am connecting using WiFi, I also create a file in /boot called wpa_supplicant.conf with the following info:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
	ssid="network-Service-Set-IDentifier"
	psk="network-WPA/WPA2-security-passphrase"
	key_mgmt=WPA-PSK
}
Edit country=, ssid= and psk= with your information and save it.
www.raspberrypi.org/blog/another-update-raspbian/ wrote:• If a wpa_supplicant.conf file is placed into the /boot/ directory, this will be moved to the /etc/wpa_supplicant/ directory the next time the system is booted, overwriting the network settings; this allows a Wifi configuration to be preloaded onto a card from a Windows or other machine that can only see the boot partition.
I then safely eject the card and boot my Raspberry Pi with it.

To answer the rest of the questions above:
7. Yes, I disabled hidden file extensions when I first installed Windows 10 on my computer.
8. No, the "ssh" file was automatically deleted when SSH was successfully enabled.
9. No, I am connecting using WiFi as described above.
10. Yes, I am connecting to the same router and internal network as my other computers.

With the above procedure I can SSH in using PuTTY in Windows, or from the CLI/terminal in Linux.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Re: Raspberry PI SSH with Windows 10 and ubuntu

Tue Dec 27, 2016 1:20 pm

1. Where did you download the image?
https://www.raspberrypi.org/downloads/raspbian/
In that the first one jasse with PIXEL.
2. Did you verify the SHA-1 hash?
with hashcheck on windows and it matchs
3. How did you extract the .img file from the .zip archive?
Normally, Right click and extract here.
4. How did you write the image to the card?
Using Win32disk imager software
5. Did you safely eject the card and re-insert it before writing the "ssh" file?
yes
6. How did you create the "ssh" file?
echo "">E:\ssh
7. Do you have "Hide extensions for known file types" disabled in Windows (assuming you used Windows to image the card)?
Not yet i think
8. Is the "ssh" file still in /boot after you have started the Pi and attempted to use SSH?
No, it was not so i created a new one.
9. Is your Raspberry Pi connected to your router with an Ethernet cable? If not, please describe your setup in detail.
no
I have RPI connected with PC via ethernet cable. I have powed Pi properly.
10. Is your Pi on the same network as your other computers (not on a "guest" or external/remote network)?
Yes

The two biggest issues with

ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Re: Raspberry PI SSH with Windows 10 and ubuntu

Tue Dec 27, 2016 2:21 pm

How should I shut down rpi if I cant ssh in it in order not to burn image again?

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: Raspberry PI SSH with Windows 10 and ubuntu

Tue Dec 27, 2016 2:33 pm

On Windows, could you "ping raspberrypi.local" ?

JumpZero
Posts: 1118
Joined: Thu Mar 28, 2013 7:35 pm
Location: 127.0.0.1

Re: Raspberry PI SSH with Windows 10 and ubuntu

Tue Dec 27, 2016 4:15 pm

allfox wrote:On Windows, could you "ping raspberrypi.local" ?
Windows doesn't have avahi/bonjour by default. You have to add it. At least on Windows 7.
10 I don't know
Last edited by JumpZero on Tue Dec 27, 2016 4:19 pm, edited 1 time in total.

JumpZero
Posts: 1118
Joined: Thu Mar 28, 2013 7:35 pm
Location: 127.0.0.1

Re: Raspberry PI SSH with Windows 10 and ubuntu

Tue Dec 27, 2016 4:19 pm

ujjwalrathod007 wrote:9. Is your Raspberry Pi connected to your router with an Ethernet cable? If not, please describe your setup in detail.
no
I have RPI connected with PC via ethernet cable.
Sounds not very good...
Why not PC and Pi both connected to your router (and router is the dhcp server)

ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Re: Raspberry PI SSH with Windows 10 and ubuntu

Tue Dec 27, 2016 5:15 pm

There is one hint may be.I saw my SD card the ssh file is not there now.. Whats the reason?

User avatar
HawaiianPi
Posts: 5507
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry PI SSH with Windows 10 and ubuntu

Tue Dec 27, 2016 6:07 pm

ujjwalrathod007 wrote:8. Is the "ssh" file still in /boot after you have started the Pi and attempted to use SSH?
No, it was not...
This is good. It indicates SSH was enabled.
ujjwalrathod007 wrote:9. Is your Raspberry Pi connected to your router with an Ethernet cable? If not, please describe your setup in detail.
no
I have RPI connected with PC via ethernet cable...
There is your problem. You are not connecting your Pi to your network, you are connecting it directly to your computer. This will not work without additional steps. You should connect your Pi to your router with the Ethernet cable, or you could connect wirelessly by adding the wpa_supplicant.conf file to /boot as well (see my previous post above).

Direct connections are possible, but it is a much more involved process. Here is an old link to guides from the blog. Not sure if there are any newer guides as I don't do direct connections.

At this point I would start over with a fresh image and your Pi connected to your router.
ujjwalrathod007 wrote:How should I shut down rpi if I cant ssh in it in order not to burn image again?
If you are going to re-image the card then it doesn't matter.

Otherwise you will need a keyboard connected to your Pi. Here is a copy of a post from another thread.
HawaiianPi wrote:If your Pi is connected to a screen with a keyboard and mouse (or at least a keyboard) you can try a safe reboot or power-off with the following procedure.

Press and hold both the ALT and Print Screen keys.
While holding those keys, hit the following keys in sequence, but wait a few seconds between each key.

To safely reboot the system:
R E I S U B

To safely power off the system:
R E I S U O

The only difference is the last key. "B" for boot (reboot), or "O" for off (shutdown).

Mnemonic to help you remember the reboot sequence: Reboot Even If System Utterly Broken.
If you use the shutdown procedure, watch the green activity LED. When the Pi shuts down there will be 10 flashes, with the last one a bit longer than the rest, and after that no more activity. That indicates the Pi has properly shut down.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
DougieLawson
Posts: 38543
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry PI SSH with Windows 10 and ubuntu

Tue Dec 27, 2016 8:39 pm

JumpZero wrote:
allfox wrote:On Windows, could you "ping raspberrypi.local" ?
Windows doesn't have avahi/bonjour by default. You have to add it. At least on Windows 7.
10 I don't know
Win8, Win8.1 & Win10 all have Bonjour (aka mDNS) built-in.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

ujjwalrathod007
Posts: 95
Joined: Thu Dec 22, 2016 10:09 am

Re: Raspberry PI SSH with Windows 10 and ubuntu

Tue Dec 27, 2016 10:12 pm

Hello, I followed this guide
https://pihw.wordpress.com/guides/direc ... onnection/

I have edited the cmdline file...and add the ip 169.254.0.1 or 169.254.0.2 i dont remember right now. but when i do ifconfig it does not show that ip instead it will create a new one..

I am able to shut down the pi properly ... But when i turn it on. my ethenet connection led on pi will do ON-OFF several times... so I have to wait...

But still I am not able to ssh unfortunetely.

Return to “General discussion”