Neuer Tag, neue Probleme.
Hallo erstmal,
habe es endlich geschafft Geräte in ALexa hinzuzufügen und sie werden auch erfolgreich über Alexa geschaltet.
Nach einiger Zeit ist die Verbindung zwischen Putty und dem Raspberry abgebrochen und Fhem war nicht mehr erreichbar.
Ich kann mich nicht mehr als "pi" anmelden. Es kommt immer die Meldung "Access denied".
Kann mich nur noch als root anmelden.
Habe versucht das passwort von Pi mit sudo passwd pi zu ändern welches auch akzeptiert wird.
Wenn ich mich dann als nutzer pi anmelde wird pi aber nicht in grün sondern wie der rootbenutzer in grau angezeigt.
Wenn ich nun sudo reboot mache kann ich mich mit pi nicht mehr anmelden...
Fhem startet auch nicht mehr automatisch muss ich mit sudo service fhem start als root selber starten.
Hat jemand eine Idee?
Es muss mit dem alexa-fhem zusammenhängen. Fhem lief über wochen normal. Als ich die Geräte in fhem für alexa angelegt habe ging es nach einer gewissen Zeit los. Putty hat die verbindung einfach abgebrochen und fhem war nicht mehr erreichbar zusätzlich kann ich mich eben mit pi nicht mehr anmelden. x:
FHEM 5.8 und alexa-fhem 0.4.4 und raspian stretch wird benutzt
Ich hab keine Ahnung.
Also hab es installiert mit folgenden Anleitungen:
https://haus-automatisierung.com/hardware/fhem/…em-steuern.html
und eben
https://wiki.fhem.de/wiki/Alexa-Fhem
Hier mein /etc/sudoers:
Spoiler anzeigen
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
Ausgabe von 010_pi-nopasswd
Code:
Spoiler anzeigen
GNU nano 2.7.4 Datei: 010_pi-nopasswd
pi ALL=(ALL) NOPASSWD: ALL
Ausgabe von ls -a /home/pi
Spoiler anzeigen
pi@raspberrypi:/etc/sudoers.d$ cd
pi@raspberrypi:~$ ls -a /home/pi
. .config Music .selected_editor
.. .dbus .nano smarthome2.fhem-albert.de.conf
.alexa Desktop .npm Templates
alexa-fhem Documents Pictures .themes
alexa-fhem-0.4.4.tgz Downloads .profile Videos
.bash_history fhem-5.8.deb Public .Xauthority
.bash_logout .gnupg python_games .xsession-errors
.cache .local .rnd .xsession-errors.old
pi@raspberrypi:~$
und Ausgabe von cat /etc/passwd |grep pi
Spoiler anzeigen
pi@raspberrypi:~$ cat /etc/passwd |grep pi
pi:x:1000:1000:,,,:/home/pi:/bin/bash
"/home/pi/bash_history" sieht aus wie folgt:
Spoiler anzeigen
pi@raspberrypi:~/alexa-fhem$ cat /home/pi/.bash_history
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y autoremove && sudo reboot
service dbus start
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y autoremove && sudo reboot
sudo apt-get -y install libjson-perl libdatetime-format-strptime-perl
cd /opt/fhem/log
ls -la
sudo shutdown -h 0
ping hausautomatisierung.fhem-albert.de
sudo update
sudo get-apt update
sudo apt-get update
sudo apt-get upgrade
cd /opt
sudo git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
./letsencrypt-auto certonly --rsa-key-size 4096 -d hausautomatisierung.fhem-albert.de
sudo ln -s /opt/bitnami/apache2/bin/apachectl /usr/bin/apache2ctl
./letsencrypt-auto certonly --rsa-key-size 4096 -d hausautomatisierung.fhem-albert.de
sudo a2enmod proxy proxy_http
cd
sudo apt-get install apache2
sudo a2enmod proxy proxy_http
systemctl restart apache2
clear
sudo a2enmod proxy proxy_http
sudo service apache2 restart
cd /etc/apache2/sites-available/
sudo nano hausautomatisierung.fhem-albert.de.conf
sudo apt-get install libapache2-mod-proxy-html
sudo a2enmod proxy_html
systemctl restart apache2
cd /etc/apache2/sites-enabled
sudo ln -s ../sites-available/hausautomatisierung.fhem-albert.de.conf .
cd
clear
sudo htpasswd -c -s /etc/fhem-htpasswd frank
sudo a2enmod ssl proxy_html
sudo sudo a2enmod ssl proxy_html
sudo apachectl configtest
sudo service apache2 restart
sudo apachectl configtest
sudo a2enmod ssl proxy_html
sudo apachectl configtest
sudo nano /etc/apache2/apache2.conf
sudo nano /etc/apache2/sites-enabled/hausautomatisierung.fhem-albert.conf
sudo nano /etc/apache2/sites-enabled/hausautomatisierung.fhem-albert.de.conf
sudo apachectl configtest
sudo nano /etc/apache2/sites-enabled/hausautomatisierung.fhem-albert.de.conf
clear
sudo nano /etc/letsencrypt/options-ssl-apache.conf
sudo nano /etc/apache2/sites-enabled/hausautomatisierung.fhem-albert.de.conf
sudo apachectl configtest
sudo nano /etc/apache2/apache2.conf
ln -s /etc/apache2/conf-available/mysite.conf /etc/apache2/conf-enabled/mysite.conf
sudo ln -s /etc/apache2/conf-available/mysite.conf /etc/apache2/conf-enabled/mysite.conf
sudo apachectl configtest
sudo ln -s /etc/apache2/conf-available/hausautomatisierung.fhem-albert.de.conf /etc/apache2/conf-enabled/hausautomatisierung.fhem-albert.de.conf
sudo apachectl configtest
cd /etc/apache2/
cd /conf-available
cd /conf-available/
cd conf-available/
ls -la
sudo nano hausautomatisierung.fhem-albert.de.conf
sudo apachectl configtest
sudo nano /etc/apache2/conf-enabled/hausautomatisierung.fhem-albert.de.conf
a2enmod ssl
a2ensite ryogasp.com-ssl
a2ensite hausautomatisierung.fhem-albert.de-ssl
cd /etc/apache2/sites-available/
sudo nano hausautomatisierung.fhem-albert.de-ssl.conf
a2ensite hausautomatisierung.fhem-albert.de-ssl
sudo a2ensite hausautomatisierung.fhem-albert.de-ssl
service apache2 reload
sudo a2dissite 000-default.conf
sudo systemctl restart apache2
cd
sudo so
sudo su
sudo apachectl configtest
cd /opt
sudo cd letsencrypt
cd letsencrypt
./letsencrypt-auto certonly --rsa-key-size 4096 -d
./letsencrypt-auto certonly --rsa-key-size 4096 -d smarthome2.fhem-albert.de
cd /etc/apache2/sites-available/
sudo nano smarthome2.fhem-albert.de.conf
./letsencrypt-auto certonly --rsa-key-size 4096 -d smarthome2.fhem-albert.de
cd /etc/apache2/sites-available/
cd letsencrypt
cd /opt/letsencrypt/
./letsencrypt-auto certonly --rsa-key-size 4096 -d smarthome2.fhem-albert.de
sudo nano /etc/apache2/conf-enabled/hausaotomatisierung.fhem-albert.conf
sudo nano /etc/apache2/conf-enabled/hausautomatisierung.fhem-albert.conf
/etc/apache2/conf-enabled/hausautomatisierung.fhem-albert.de.conf
sudo nano /etc/apache2/conf-enabled/hausautomatisierung.fhem-albert.de.conf
./letsencrypt-auto certonly --rsa-key-size 4096 -d smarthome2.fhem-albert.de
sudo service apache2 stop && /opt/letsencrypt/letsencrypt-auto renew && sudo service apache2 start
sudo apachectl configtest
sudo nano /etc/apache2/sites-available/smarthome2.fhem-albert.de-https.conf
sudo a2ensite your-domain.com-https.conf
sudo a2ensite sudo a2ensite your-domain.com-https.conf-https.conf
sudo a2ensite smarthome2.fhem-albert.de-https.conf
sudo systemctl reload apache2
sudo systemctl start apache2
sudo systemctl start apache2
sudo start apache2
sudo startservice apache2
sudo start service apache2
sudo start service apache2
sudo service start apache2
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 restart
sudo a2ensite smarthome2.fhem-albert.de-https.conf
sudo htpasswd -c -s /etc/fhem-htpasswd frank
sudo a2enmod ssl proxy_html
sudo apachectl configtest
sudo nano ////etc/apache2/conf-enabled/hausautomatisierung.fhem-albert.de.conf
sudo nano /etc/apache2/apache2.conf
sudo apachectl configtest
sudo nano /etc/apache2/apache2.conf
sudo apachectl configtest
sudo nano /etc/apache2/apache2.conf
sudo nano ////etc/apache2/conf-enabled/hausautomatisierung.fhem-albert.de.conf
sudo apachectl configtest
sudo nano /etc/apache2/apache2.conf
sudo nano /etc/apache2/conf-available/smarthome2.fhem-albert.de.conf
cd
/etc/apache2/conf-enabled
cd /etc/apache2/conf-enabled
ln -s /etc/apache2/conf-available/smarthome2.fhem-albert.de.conf .
sudo ln -s /etc/apache2/conf-available/smarthome2.fhem-albert.de.conf .
service apache2 restart
sudo apachectl configtest
sudo service apache2 restart
cd /etc/apache2/conf-enabled
cd /opt
cd letsencrypt
./letsencrypt-auto certonly --rsa-key-size 4096 -d smarthome2.fhem-albert.de
sudo service apache2 stop
./letsencrypt-auto certonly --rsa-key-size 4096 -d smarthome2.fhem-albert.de
sudo service apache2 start
sudo service apache2 restart
sudo apachectl configtest
~sudo htpasswd -c -s /etc/fhem-htpasswd frank
sudo htpasswd -c -s /etc/fhem-htpasswd frank
sudo apt-get install libapache2-mod-proxy-html
cd /etc/apache2/sites-enabled
sudo ln -s ../sites-available/smarthome2.fhem-albert.de.conf .
0 23 * * * sudo service apache2 stop && /opt/letsencrypt/letsencrypt-auto renew && sudo service apache2 start
cd
0 23 * * * sudo service apache2 stop && /opt/letsencrypt/letsencrypt-auto renew && sudo service apache2 start
crontab -e
sudo nano smarthome2.fhem-albert.de.conf
sudo apachectl configtest
sudo apachectl configtestsudo a2enmod ssl proxy_html
~
sudo a2enmod ssl proxy_html
sudo apachectl configtest
sudo service apache2 restart
sudo nano /etc/apache2/apache2.conf
sudo service apache2 restart
systemctl status apache2.service
sudo nano /etc/apache2/apache2.conf
systemctl status apache2.service
sudo nano /etc/apache2/conf-enabled/mysite.conf:~
sudo nano /etc/apache2/conf-enabled/mysite.conf:
sudo nano /etc/apache2/conf-enabled/mysite.conf
sudo service apache2 restart
sudo apachectl configtest
sudo apt-get update
sudo apt-get upgrade
cd
sudo apt-get update
sudo apt-get upgrade
sudo apt-get update
sudo apt-get upgrade
ls -la
cd /etc/ssh/
ls -la
sudo nano sshd_config
service ssh restart
cd /etc/ssh/
sudo nano sshd_config
service ssh restart
sudo restart
sudo reboot
sudo su
ls -la
tar -xzf alexa-fhem-0.4.4.tgz
mv package alexa-fhem
cd alexa-fhem
npm install
ls -la
npm install
cd
sudo apt-get install build-essential libssl-dev
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
cd alexa-fhem
nom install
npm install
./createKey.sh
ls -la
ls -la
ls -la | grep pem
cd
clear
mkdir ~/.alexa
cd alexa-fhem/
cp config-sample.json ~/.alexa/config.json
sudo nano ~/.alexa/config.json
./bin/alexa
sudo nano ~/.alexa/config.json
./bin/alexa
sudo nano ~/.alexa/config.json
./bin/alexa
sudo restart
sudo reboot
cd alexa-fhem/
./bin/alexa
./bin/alexa --debug
sudo shutdown
cdc
cd alexa-fhem/
./bin/alexa
ls -la
sudo reboot
sudo service fhem start
cd alexa-fhem/
sudo alexa-fhem
sudo cd alexa-fhem
sudo cd /alexa-fhem
cd alexa-fhem
cd alexa-fhem
sudo cd alexa-fhem
sudo visudo
./bin/alexa
sudo ./bin/alexa
cd
sudo raspi-config
exit
cd /alexa-fhem
cd alexa-fhem
./bin/alexa --debug
sudo reboot
cd
sudo nano boot.config.txt
sudo nano /boot/config.txt
sudo service fhem start
cd alexa-fhem
./bin/alexa
sudo visudo
sudo visudo
sudo reboot
cd
sudo service fhem start
cd alexa-fhem
./bin/alexa
sudo reboot
cd
sudo service fhem start
cd alexa-fhem
./bin/alexa
./bin/alexa
./bin/alexa
sudo reboot
cd
cd alexa-fhem
./bin/alexa
sudo reboot
cd
sudo service fhem start
cd alexa-ghem
cd alexa-fhem
./bin/alexa
sudo shutdown -h 0
cd
sudo service fhem start
cd alexa-fhem
./bin/alexa
cd
cd alexa-fhem
./bin/alexa
su pi
su pi
sudo reboot
cd
sudo service fhem start
cd alexa-fhem
./bin/alexa
sudo visudo
./bin/alexa
cd
ls -la
cd alexa-fhem
./bin/alexa
sudo nano /etc/sudoers.d/
cd
cd etc
cd /etc
cd /etc/
ls -la
cd
ls -la
su root
Hier noch die root-history (ja ich habs gemerkt manche Befehle waren nicht sehr intelligent ;D waren nur paar lange Tage in letzter Zeit)
Spoiler anzeigen
root@raspberrypi:~# cat .bash_history
sudo a2enmod ssl proxy_html
sudo apachectl configtest
systemctl disable apache2
systemctl disable apache2
systemctl enable apache2
sudo apachectl configtest
sudo restart
restart
reboot
passwd
exit
exit
sudo service fhem start
cd ~/alexa-fhem/
ls -la
cd
sudo reboot
sudo service fhem start
raspi-config
exit
passwd pi
sudo reboot
sudo service fhem start
sudo service alexa-fhem start
ls -la
cd /home/pi/
cd ~/alexa-fhem/
ls -la
cd /alexa-fhem
cd /alexa-fhem/
cd alexa-fhem/
-/bin/alexa --debug
./bin/alexa --debug
cd
sudo passwd pi
exit
sudo service fhem start
cd /home/pi/alexa-fhem/
./bin/alexa
sudo service alexa-fhem start
sudo /etc/init.d/alexa start
cd
sudo /etc/init.d/alexa start
sudo service alexa start
cd /home/pi/alexa-fhem/
sudo service alexa start
ls -la
cd
apt-get update
apt-get upgrade
sudo nano /etc/sudoers
sudo reboot
sudo nano /etc/sudoers
su pi
exit
sudo pi
su pi
su pi
su pi
sudo su
sudo service fhem start
cd alexa-fhem
cd
cd alexa-fhem
su pi
sudo pi
cd
su pi
su pi
ls -la
Aufgefallen ist mir auch noch die Datei .bashrs fehlt im Verzeichnis /home/pi/
wenn ich die runterlade auf meinen laptop (windows) geht der . von .bashrc weg.
Heißt ohne den . ist die Datei auch nutzlos oder?
also mit "sudo mv bashrc .bashrc" den punkt hinzugefügt
sudo reboot
nach dem reboot ist die Datei allerdings wieder weg...
Das sagt die Konsole nachdem ich reboote und ls -la in /home/pi/ ausführe:
Spoiler anzeigen
pi@raspberrypi:~$ cd /home/pi/
pi@raspberrypi:~$ ls -la
insgesamt 18504
drwxr-xr-x 21 pi pi 4096 Dez 30 21:42 .
drwxr-xr-x 3 root root 4096 Sep 7 14:59 ..
drwxr-xr-x 2 pi pi 4096 Dez 30 10:49 .alexa
drwxr-xr-x 5 pi pi 4096 Dez 30 10:30 alexa-fhem
-rw-r--r-- 1 root root 39546 Dez 28 21:14 alexa-fhem-0.4.4.tgz
-rw------- 1 pi pi 9115 Dez 30 21:42 .bash_history
-rw-r--r-- 1 pi pi 220 Sep 7 14:59 .bash_logout
drwxr-xr-x 5 pi pi 4096 Sep 7 16:12 .cache
drwx------ 8 pi pi 4096 Nov 19 10:19 .config
drwx------ 3 pi pi 4096 Nov 19 10:07 .dbus
drwxr-xr-x 2 pi pi 4096 Sep 7 16:12 Desktop
drwxr-xr-x 5 pi pi 4096 Sep 7 15:45 Documents
drwxr-xr-x 2 pi pi 4096 Sep 7 16:12 Downloads
-rw-r--r-- 1 pi pi 8647 Dez 30 21:26 eingabensicherung
-rw-r--r-- 1 root root 18761948 Feb 19 2017 fhem-5.8.deb
drwx------ 3 pi pi 4096 Sep 7 16:12 .gnupg
drwxr-xr-x 3 pi pi 4096 Sep 7 15:45 .local
drwxr-xr-x 2 pi pi 4096 Sep 7 16:12 Music
drwxr-xr-x 2 pi pi 4096 Nov 24 15:16 .nano
drwxr-xr-x 72 pi pi 4096 Dez 30 10:29 .npm
drwxr-xr-x 2 pi pi 4096 Sep 7 16:12 Pictures
-rw-r--r-- 1 pi pi 675 Sep 7 14:59 .profile
drwxr-xr-x 2 pi pi 4096 Sep 7 16:12 Public
drwxr-xr-x 2 pi pi 4096 Sep 7 15:45 python_games
-rw------- 1 pi pi 1024 Dez 30 10:29 .rnd
-rw-r--r-- 1 pi pi 66 Nov 24 15:16 .selected_editor
-rw-r--r-- 1 root root 1036 Nov 24 15:18 smarthome2.fhem-albert.de.conf
drwxr-xr-x 2 pi pi 4096 Sep 7 16:12 Templates
drwxr-xr-x 3 pi pi 4096 Sep 7 16:12 .themes
drwxr-xr-x 2 pi pi 4096 Sep 7 16:12 Videos
-rw------- 1 pi pi 56 Dez 30 21:42 .Xauthority
-rw------- 1 pi pi 3954 Dez 30 21:42 .xsession-errors
-rw------- 1 pi pi 3954 Dez 30 21:35 .xsession-errors.old
Im großen und ganzen ich brauch dringend hilfe
Muss mich sonst immer als root anmelden dann zu pi wechseln und alexa-fhem und fhem manuell starten.
mfg und danke schonmal im vorraus.