WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Changing tc passwd via SSH -> can't connect via SSH anymore  (Read 2193 times)

Offline ian57

  • WikiUser
  • *
  • Posts: 21
Changing tc passwd via SSH -> can't connect via SSH anymore
« on: February 26, 2014, 07:28:31 AM »
After changing the tc password via SSH or from the local console, i can't connect via ssh anymore. It always asks me to change my expired password :

$ ssh tc@192.168.1.45
tc@192.168.1.45's password:
 (�-
 //\   Core is distributed with ABSOLUTELY NO WARRANTY.
 v_/_           www.tinycorelinux.com
 
WARNING: Your password has expired.
You must change your password now and login again!
Changing password for tc
Old password:
New password:
Retype password:
Password for tc changed by tc
Connection to 192.168.1.45 closed.
$ ssh tc@192.168.1.45
tc@192.168.1.45's password: #### NEW PASSWD##
 (�-
 //\   Core is distributed with ABSOLUTELY NO WARRANTY.
 v_/_           www.tinycorelinux.com
 
WARNING: Your password has expired.
You must change your password now and login again!
Changing password for tc
Old password:


Some details, after changing the passwd, i use backup to keep the current /etc/passwd and /etc/shadow. After reboot i get 2 files for each passwd and passwd-, shadow and shadow-.
the password hash is different in shadow and shadow-.

« Last Edit: February 26, 2014, 07:42:54 AM by ian57 »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 6995
    • My Community Forum
Re: Changing tc passwd via SSH -> can't connect via SSH anymore
« Reply #1 on: February 26, 2014, 07:40:34 AM »
Check system date. Is it year 1970 or 2014?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline ian57

  • WikiUser
  • *
  • Posts: 21
Re: Changing tc passwd via SSH -> can't connect via SSH anymore
« Reply #2 on: February 26, 2014, 07:45:07 AM »
It's 70, because i didn't find how to set the time automatically.

getTime.sh does not work on my picore.

Ok i fixed the problem : it came from the date.

 - all the file on the sd are in 2014
 - but when i start the pi, the date is not synchronized, i have to find how to do that (i force the current date with sudo ntpdate 192.168.1.254), and the date is 1/1/1970
 - so when i change the passwd via ssh the modified file is in 1970.
to fix the problem :
 -  run ntpdate to force the current date
 - make  a "touch passwd" to correct the date
 - and now i can connect via ssh

Thanks a lot bmarkus ;-)
« Last Edit: February 26, 2014, 07:55:59 AM by ian57 »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 6995
    • My Community Forum
Re: Changing tc passwd via SSH -> can't connect via SSH anymore
« Reply #3 on: February 26, 2014, 07:53:41 AM »
Try piCore-5.2
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline ian57

  • WikiUser
  • *
  • Posts: 21
Re: Changing tc passwd via SSH -> can't connect via SSH anymore
« Reply #4 on: February 26, 2014, 07:58:07 AM »
Juste out ;-), i will try it right now

thanks

Offline ian57

  • WikiUser
  • *
  • Posts: 21
Re: Changing tc passwd via SSH -> can't connect via SSH anymore
« Reply #5 on: February 26, 2014, 08:11:17 AM »
Juste out ;-), i will try it right now

thanks

Ok the new getTime.sh command does not work for me, but i'm behind a firewall

i can use the /bin/ntpd -q -p 192.168.1.254 (address of my firewall which has ntp too) in the bootlocal.sh to do the trick

Thanks

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 6995
    • My Community Forum
Re: Changing tc passwd via SSH -> can't connect via SSH anymore
« Reply #6 on: February 26, 2014, 08:16:01 AM »
Thanks for the feedback. You can add it to bootlocal.sh to get time at startup.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline ian57

  • WikiUser
  • *
  • Posts: 21
Re: Changing tc passwd via SSH -> can't connect via SSH anymore
« Reply #7 on: February 26, 2014, 08:48:46 AM »
Huuuu that's what i did ;-)

thanks