|
|
#1 |
|
Connoisseur
![]() Posts: 60
Karma: 10
Join Date: Apr 2023
Device: Kobo Nia
|
Niluje's Kobo tool's ssh server
How do I disable no password logins for ssh, and get key based auth working? I edited sshd_config in both /etc/ssh and usr/local/niluje/etc/ssh to no avail. For what its worth I deleted many tools in his package because they were slowing my Nia down a bit
|
|
|
|
|
|
#2 |
|
Connoisseur
![]() Posts: 60
Karma: 10
Join Date: Apr 2023
Device: Kobo Nia
|
How odd, passwordless login is now successfully disabled. Iguess Ididnt reboot? Did ireally forget to try that? So to anyone else wondering, edit sshd_config in the locations above
they each state where ssh is located inthe config, also set apasswd using passwd command. ps command says sshd is located in usr/sbin wait okay seems only the one in etc/ssh works, edit that one okay after starting from scratch, rename ssh_disabled to ssh_enabled in the .kobo folder, edit sshd_config, set passwd, setting passwd before doing those 2 renders the password unusable for some reason, but I think I had a conflicting installation somehow bc I had ssh enabled even without renaming it, maybe from koreader. okay im lost. when i try to use kobostuff, the full package when I ssh into my device it freezes and I cant do anything. So I removed most of the stuff by trial and error until I got it working, but... ssh-enabled doesnt do anything for me! Except enabling it means when I ssh the next time and forever after even if its diabled, I get an unknown uid error. When I add line to fix this, thanks to chatgpt giving an answer, it fixes temporarily before reverting the next reboot. Enabling ssh by renaming didnt allow me to set sshd_config even though before I was able to get it working somehow. My eearlier confusion was due to the fact I was soft resetting not hard resetting, the ssh server survives soft resetting... disabling ssh-enabled does nothing, I can continue to ssh. sigh trying again after a while, somehow no uuid fixed itself! i can set passwords again... but i didnt do anything... huh, editing /etc/passwd with vi, adding the letter x between the empty fields for root seems to have fixed the problem, although I remember this working only temporarily before it seems its a permanent fix... Last edited by noobyme; 03-13-2026 at 08:18 PM. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Connoisseur
![]() Posts: 60
Karma: 10
Join Date: Apr 2023
Device: Kobo Nia
|
After bashing ChatGPT I finally found a solution to unknown uuid error, well I tried adding to rcS first i broke wifi scanning, then when i went to remove the lines from above i ended up bootlooping my device... be careful. After trial and error I then saw ssh file...
vi /etc/init.d/ssh # Fix passwd cat <<EOF > /etc/passwd root:x:0:0:root:/root:/bin/sh EOF # Ensure root exists #grep -q '^root:' /etc/passwd || echo 'root:x:0:0:root:/root:/bin/sh' >> /etc/passwd # Fix NSS so UID 0 resolves to root cat <<EOF > /etc/nsswitch.conf passwd: files group: files shadow: files hosts: files dns networks: files dns EOF Then hit esc, :wq dghfsjh found this line in /usr/local/niluje/bin/stuff-daemons.sh ## NOTE: Comment me out if you want dropbear to actually check passwords SSHD_OPTS="${SSHD_OPTS} -n" found this okay this fixed my issue, passwords r being checked! [root@kobo ~]# cat etc/init.d/ssh #!/bin/sh ONBOARD_PARTITION=$1 SSH_ENABLED_FILE=/mnt/onboard/.kobo/ssh-enabled SSH_DISABLED_FILE=/mnt/onboard/.kobo/ssh-disabled PASS_SET=/.login_pass_set if [ -e ${SSH_ENABLED_FILE} ]; then echo "Starting sshd" else if [ ! -e ${SSH_DISABLED_FILE} ]; then touch ${SSH_DISABLED_FILE} echo "To enable ssh:" >> ${SSH_DISABLED_FILE} echo "- Rename this file to ssh-enabled" >> ${SSH_DISABLED_FILE} echo "- Reboot the device" >> ${SSH_DISABLED_FILE} echo "- Connect via: ssh root@<device_ip>" >> ${SSH_DISABLED_FILE} fi if [ -f ${PASS_SET} ]; then rm ${PASS_SET} fi echo "NOT starting sshd (disabled)" exit 0 fi if [ ! -d /var/empty ]; then mkdir -p /var/empty chmod 755 /var/empty fi [ ! -d /dev/pts ] && mkdir -p /dev/pts /bin/mount -t devpts none /dev/pts -o mode=0622 if ! grep '^sshd:' /etc/group > /dev/null 2>&1; then addgroup --gid 999 sshd fi # Ensure root exists #grep -q '^root:' /etc/passwd || echo 'root:x:0:0:root:/root:/bin/sh' >> /etc/passwd #echo 'root:x:0:0:root:/root:/bin/sh' >> /etc/passwd # Ensure NSS works cat <<EOF > /etc/nsswitch.conf passwd: files group: files shadow: files hosts: files dns networks: files dns EOF ROOT_PASS_EXISTS=`grep '^root:' /etc/passwd | awk -F: '{print $2}'` #if [ ! -f "${PASS_SET}" ] && [ ! -z "${ROOT_PASS_EXISTS}" ]; #then # passwd -d root >/dev/null 2>&1 #fi #echo 'root:x:0:0:root:/root:/bin/sh' >> /etc/passwd # Ensure root exists #grep -q '^root:' /etc/passwd || echo 'root:x:0:0:root:/root:/bin/sh' >> /etc/passwd sed -i 's/^\([^:]*\)::/\1:x:/' /etc/passwd /usr/sbin/sshd So the password is always being deleted because ./login_pass_set is never created, why? idk, I searched the entire kobostuff folder for it but its not present... maybe im missing some files that create it Commenting this out fixes ROOT_PASS_EXISTS=`grep '^root:' /etc/passwd | awk -F: '{print $2}'` #if [ ! -f "${PASS_SET}" ] && [ ! -z "${ROOT_PASS_EXISTS}" ]; #then # passwd -d root >/dev/null 2>&1 #fi However if you have password not set and root pass not exist, then deletes it? This script runs every time ... if you have password set it should create the pass set variable thing Last edited by noobyme; 03-19-2026 at 08:15 PM. |
|
|
|
|
|
#4 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,769
Karma: 152504945
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Kobo Elipsa, Kobo Clara 2E, Kobo Nia, Kobo Clara HD reset steps
|
|
|
|
|
|
|
#5 | |
|
Connoisseur
![]() Posts: 60
Karma: 10
Join Date: Apr 2023
Device: Kobo Nia
|
Quote:
AHAHAHA I GOT IT. By default KoboStuff uses dropbear sshd instead of openssh sshd, and apparently /etc/ssh/sshd_config is for openssh only and dropbear uses cli flags instead Last edited by noobyme; Yesterday at 07:38 PM. |
|
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SSH server not working in firmware 5.18.5 | Jose | KOReader | 5 | 10-10-2025 06:51 PM |
| PW2 SSHD Lite (SSH Server, for your kindle PW!) | merith.tk | Kindle Developer's Corner | 0 | 04-21-2023 04:18 PM |
| Recommended SSH server for android phone | dhdurgee | Android Developer's Corner | 5 | 05-07-2015 01:12 PM |
| M92: password and users (eg. ssh/ssh-server) | lepau | Onyx Boox | 1 | 11-15-2013 11:46 AM |
| Does exist a SSH Help Tool? | jmesar | Kindle Developer's Corner | 2 | 04-20-2012 03:26 PM |