2 issues Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
forevergreen
Posts: 20
Joined: Tue Feb 02, 2021 9:01 am

2 issues

Post by forevergreen »

I am facing 2 issues:-

1- PiHole time is not in sync with DiePi. when i run "date" the DietPi has the correct date but not on the PiHole. I was told to use:
timedatectl list-timezones

to set the time but timedatectl does not seem to be on DietPi. Any help?


2- I wanted to create a new user with root privlidges so I used the command " useradd -ou 0 -g 0 (username) " then I used "passwd (username) " to se the password.

when I do "~echo (username)" it shoes its in the /home directory. When I go to the home directory and do "ls" there is only DietPi.

I tried to ssh in with that username, I enter the set password, I get "Connection to (DietPi) closed. Any idea whats going on?
User avatar
WarHawk
Posts: 738
Joined: Thu Jul 20, 2017 8:55 am

Re: 2 issues

Post by WarHawk »

Never saw that command for adduser

Usually just an adduser to create a user is needed first I believe

I have seen this one for sudoer

Code: Select all

sudo usermod -a -G sudo <username>
User avatar
trendy
Posts: 342
Joined: Tue Feb 25, 2020 2:54 pm

Re: 2 issues

Post by trendy »

Is the time on Pihole deviating some minutes or hours? Is the difference the same by any chance as your timezone with UTC?

First create a user, then add him to sudoers. Use -m to have the home directory created from skel.
User avatar
Joulinar
Posts: 5115
Joined: Sat Nov 16, 2019 12:49 am

Re: 2 issues

Post by Joulinar »

timedatectl should be available as part of systemd package. However it require dbus package to run. Check if dbus was already installed

Code: Select all

dpkg -l dbus
If needed just install via apt

Code: Select all

apt update
apt install dbus
Anyway timedatectl list-timezones doesn't do anything except listing down all available time zone. If you need to change time zone, use dietpi-config pls. There you can set required time zone. Checking actual time zone can be done as well by running

ls -l /etc/localtime

Anyway there are not much reason why a single application is running on a different time than system. But as @trendy already ask, what is the time difference? Full hours? or minutes?

By default DietPi is not doing anything on PiHole configuration to have the time deviating from system clock.

Regarding the user. As stated by the other, create a new user and assign them to sudoers. Following guide is for Ubuntu, but it's working same on Debian

https://linuxize.com/post/how-to-add-us ... in-ubuntu/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
forevergreen
Posts: 20
Joined: Tue Feb 02, 2021 9:01 am

Re: 2 issues

Post by forevergreen »

thanks everyone for the replies and the help!
trendy wrote: Thu Mar 18, 2021 9:41 am Is the time on Pihole deviating some minutes or hours? Is the difference the same by any chance as your timezone with UTC?

First create a user, then add him to sudoers. Use -m to have the home directory created from skel.
its about about few hours. Yes it could be the difference between my timezone and UTC!
User avatar
Joulinar
Posts: 5115
Joined: Sat Nov 16, 2019 12:49 am

Re: 2 issues

Post by Joulinar »

did you tried to change time zone using dietpi-config?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
forevergreen
Posts: 20
Joined: Tue Feb 02, 2021 9:01 am

Re: 2 issues

Post by forevergreen »

yes thank, the time on the DietPi itself is correct. The problem is on the PiHole!
User avatar
Joulinar
Posts: 5115
Joined: Sat Nov 16, 2019 12:49 am

Re: 2 issues

Post by Joulinar »

I'm not aware on a setting inside PiHole to set an own time zone. However you can check dedicated user time on OS level

Code: Select all

date #should be system time if executed as root
sudo -u pihole date
sudo -u www-data date
It should return same time for all 3 users
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
forevergreen
Posts: 20
Joined: Tue Feb 02, 2021 9:01 am

Re: 2 issues

Post by forevergreen »

Joulinar wrote: Tue Mar 23, 2021 11:07 am I'm not aware on a setting inside PiHole to set an own time zone. However you can check dedicated user time on OS level

Code: Select all

date #should be system time if executed as root
sudo -u pihole date
sudo -u www-data date
It should return same time for all 3 users
After much observation I think the PiHole has the correct time it just display it on UTC
Post Reply