Pitmaster
Posts: 14
Joined: Tue Nov 04, 2014 2:15 pm

Strange problem (bug?) setting password

Sat Oct 14, 2017 1:34 pm

Dear all,
Hi I have this strange problem.
I use Raspbian strech lite 2017-09-07. I make a micro-sd card with Rufus from Windows 10.

I boot and change the password, from raspberry to somename#05
This work. No problem, can reboot and login again with the new password. Now I go into raspi-config and set ssh to work.
Reboot and my password is changed or at least the acces for user pi is gone! Acces denied.

As long as I don't enable ssh there is no problem, as soon as I activate ssh in raspi-config I can't login again. Not with ssh from the windows machine and not directly on the board.

I have 10 boards to configure for a school project, this is the second board I do. The first didn't had this problem. Did exacly the same.

Who has an idea?

Pit.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4111
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Strange problem (bug?) setting password

Sat Oct 14, 2017 2:01 pm

How did you change the password? (ie. can/did you use the raspi-config utility).
What happens if you enable SSH before changing the password?
What happens if you use Raspbian full, rather than lite?
What is Rufus?
Trev.
Usually running Raspbian Jessie on up to 12 of 13 Pi's (an A, B1, 2xB2, 2xB+, A+, P2B, 3xP0, P0W) and Stretch on my P3B. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Pitmaster
Posts: 14
Joined: Tue Nov 04, 2014 2:15 pm

Re: Strange problem (bug?) setting password

Sat Oct 14, 2017 2:08 pm

Trevor, I did try to set ssh thru raspi-config first, then a reboot and ssh gave me a warning about the password of the user pi. Then changed the password. I can now login direct on the board. But I still cannot login thru ssh from my windows machine.

Rufus is a tool to write iso or img files to removable disks. https://rufus.akeo.ie/

I did change the password on the command line and thru raspi-config, it make no difference.
Now that it work, i did it on the commandline, as ssh asked.

But I still can't ssh to the board.

Thx, Pit

Pitmaster
Posts: 14
Joined: Tue Nov 04, 2014 2:15 pm

Re: Strange problem (bug?) setting password

Sat Oct 14, 2017 2:23 pm

It happend again. I think this time it is because i set the keyboard to my format. I think I will do all the setting up prior to the changing of the password.

Later more.........

Pit

Pitmaster
Posts: 14
Joined: Tue Nov 04, 2014 2:15 pm

Re: Strange problem (bug?) setting password

Sat Oct 14, 2017 4:29 pm

Oke, after i did all the things i wanted to do whit raspi-config, apt update/upgrade, i changed the password. After a reboot I could normally log in.
It looked oke. But then I tried my first ssh login local. As in ssh localhost. It first responded normal but then I had to give my password.

And you gues right, no go! I broke the action down with a ctrl-c and did a new passwd pi, set the same password and he didn't react to it but password rest. Normally if you reset your password to the old one it will react that it didn't set the password or something.

Now I tried to ssh to localhost and everything worked perfect. So, there is a bug! Can't be any difference.

ssh reset passwords under certain situations!

For me now it means I do all the changes, updates, etc, on board, do my first ssh onboard local and then make it headless by unplugging keyboard and screen.

Pit

klricks
Posts: 4812
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Strange problem (bug?) setting password

Sat Oct 14, 2017 5:11 pm

Logon failures to local system and logon failures via ssh are 2 different problems.
Which are you having problems with? Not clear to me from what you wrote?

Are you changing the keyboard country setting? Note that changing the setting on the local RPi system does not affect the remote keyboard via ssh.
Avoid using the # or @ character in your password as those will be different characters depending on what country setting.... GB vs US for example.
Type your password at a cl prompt to see if it is what you think.
Go here for my RPi writeup. Basic config, Serial Port add-on etc:
http://blackeagle12.net/Comp/RPi/Rpi.html Click contact icon then world icon --->

B.Goode
Posts: 4601
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Strange problem (bug?) setting password

Sat Oct 14, 2017 5:27 pm

ssh reset passwords under certain situations!
If that is true, you may have uncovered a potentially major security breach for Linux systems worldwide.

But I think you are misunderstanding what you are seeing...

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4111
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Strange problem (bug?) setting password

Sat Oct 14, 2017 6:34 pm

Ok. I've now had the time to write and boot up a Raspbian Lite system (I normally use the full version). I downloaded the current image, wrote it to a pristine 16Gb uSDHC card in an external USB-based card writer via Etcher on my Gigabyte Brix m/c. Transferred it to one of my pi zero's and let it boot up, resize the file system and then re-boot. Changed the default password, hostname, and enabled ssh via raspi-config and (only) then rebooted. Checked via ifconfig the IP address assigned to the wired ethernet (connected via a Freegene USB combined LAN & hub adapter). SSH server is up and running O.K. - as shown by this login via a PuTTY shell running on the Brix:

Code: Select all

login as: pi
pi@192.168.23.57's password:
Linux raspizero16GbLite 4.9.41+ #1023 Tue Aug 8 15:47:12 BST 2017 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Oct 14 18:17:24 2017
/usr/bin/xauth:  file /home/pi/.Xauthority does not exist
pi@raspizero16GbLite:~ $
(The xauth message is to be expected since there's no X-server running on the Lite system)
Trev.
Usually running Raspbian Jessie on up to 12 of 13 Pi's (an A, B1, 2xB2, 2xB+, A+, P2B, 3xP0, P0W) and Stretch on my P3B. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Pitmaster
Posts: 14
Joined: Tue Nov 04, 2014 2:15 pm

Re: Strange problem (bug?) setting password

Mon Oct 16, 2017 5:29 pm

And again, the fourth one i configure. Now totally on the end of my process. This one holds apache.
Set everything i needed. Connected over ssh, no problem, with new password. Then changed the ipadres from dhcp to static.
Gone password after reboot.

Pit

Mark my words: a bug.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 9595
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Strange problem (bug?) setting password

Mon Oct 16, 2017 5:45 pm

Try this, when the system ask for the user name, type in your password, does the password appear as expected?

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

Re: Strange problem (bug?) setting password

Tue Oct 17, 2017 10:54 am

Here is how I set up a Raspberry Pi for headless boot and SSH login. It works for devices with built-in WiFi like the Pi3 and Pi Zero W, and for non-wireless Pi models with a Raspbian compatible USB WiFi dongle (like my Pi0). It's all done prior to the first boot when making the SD card.
  1. Grab the latest Raspbian image from https://www.raspberrypi.org/downloads/raspbian/
  2. Grab the Etcher software from https://etcher.io/
  3. Install Etcher and use it to write the Raspbian image to your SD card. You don't need to extract the image or format the card prior to writing. Just choose the Raspbian Zip, pick your SD card and write (if you have trouble, verify the SHA256 checksum of the download).
  4. Remove and reinsert the SD card so that your Windows or Mac PC can see the small FAT32 partition on the SD card.
  5. On that small partition create a file with the name ssh or ssh.txt (it can be empty, the contents don't matter).
  6. If you are going to connect to a WiFi network, create another file called wpa_supplicant.conf which has the following inside.

    Code: Select all

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    country=US
    
    network={
    	ssid="Your network SSID"
    	psk="Your WPA/WPA2 security key"
    	key_mgmt=WPA-PSK
    }
  7. Edit country=, ssid= and psk= with your information and save the file.
  8. Safely eject the card from your PC and use it to boot the Pi.
Raspbian will delete the ssh file and enable SSH, and when it finds a wpa_supplicant.conf file, it will move it to its correct location and connect to your wireless network. The first boot can take awhile because Raspbian does some housekeeping and reboots, so give it a minute and then you should be able to SSH into it.

If you are going to be changing passwords from the Pi itself, make sure you get your localisation and keyboard settings configure first, or you may be entering something other than what you think (I strongly suspect this is your problem).
My password is the last 8 digits of Pi.

User avatar
RaTTuS
Posts: 9561
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Strange problem (bug?) setting password

Tue Oct 17, 2017 11:12 am

Pitmaster wrote:
Mon Oct 16, 2017 5:29 pm
... Then changed the ipadres from dhcp to static.
Gone password after reboot.

Pit

Mark my words: a bug.
how are you changing the dhcp to static,
are you sure you have the correct IPaddress
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Pitmaster
Posts: 14
Joined: Tue Nov 04, 2014 2:15 pm

Re: Strange problem (bug?) setting password

Thu Oct 19, 2017 12:47 pm

I am building a project.
10 raspberry's wil become a replica of the internet. So I have to configure 10 raspberry's.

The first, no problems. the second, direct at the start. The thirt, no problems. Now the fourth, fully configured, problems at the point I set the dhcp to static.
I only write a piece of code in de dhcpcd.conf file. That's it. Pasword not the same anymore.
Keyboard was changed, software installed, ssh working, updates done, complete finisched, only from dhcp to static.

And yes, as a IT teacher for Linux, whit 20 years experience (i write bad english) I know what i do to chance from dhcp to static....

Pit

Pitmaster
Posts: 14
Joined: Tue Nov 04, 2014 2:15 pm

Re: Strange problem (bug?) setting password

Thu Oct 19, 2017 12:49 pm

I really think it is a bug. The only problem is to pinpoint it. I don't have the time to do that.

Pit

Return to “Raspbian”

Who is online

Users browsing this forum: djbottrill and 23 guests