Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 02-11-2026, 09:13 PM   #1
noobyme
Connoisseur
noobyme began at the beginning.
 
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
noobyme is offline   Reply With Quote
Old 02-12-2026, 11:05 PM   #2
noobyme
Connoisseur
noobyme began at the beginning.
 
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.
noobyme is offline   Reply With Quote
Advert
Old 03-18-2026, 07:38 PM   #3
noobyme
Connoisseur
noobyme began at the beginning.
 
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.
noobyme is offline   Reply With Quote
Old 03-18-2026, 08:42 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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:
Originally Posted by noobyme View Post
shit i broke wifi, then when i went to remove the lines from above i ended up bootlooping my device...
Try a manual reset.

Kobo Elipsa, Kobo Clara 2E, Kobo Nia, Kobo Clara HD reset steps
  1. Connect your eReader to a power source by doing one of the following:
    • Turn on your computer and connect the included USB power cord to your computer first, and then your eReader.
    • Plug the wall charger (not included) to a power outlet, and then connect your eReader to the wall charger.
  2. Press and hold the power button until you see the words “Powered off” on the screen and until the power light turns off.
  3. Release the power button.
  4. Hold down the power button.
    • The power light will remain on.
    • Once the power light turns off, release the power button.
  5. Your eReader will start the factory reset process. You should see a black screen that tells you the eReader is resetting. Do not turn off your eReader during this process.
JSWolf is offline   Reply With Quote
Old 03-19-2026, 08:13 PM   #5
noobyme
Connoisseur
noobyme began at the beginning.
 
Posts: 60
Karma: 10
Join Date: Apr 2023
Device: Kobo Nia
Quote:
Originally Posted by JSWolf View Post
Try a manual reset.

Kobo Elipsa, Kobo Clara 2E, Kobo Nia, Kobo Clara HD reset steps
  1. Connect your eReader to a power source by doing one of the following:
    • Turn on your computer and connect the included USB power cord to your computer first, and then your eReader.
    • Plug the wall charger (not included) to a power outlet, and then connect your eReader to the wall charger.
  2. Press and hold the power button until you see the words “Powered off” on the screen and until the power light turns off.
  3. Release the power button.
  4. Hold down the power button.
    • The power light will remain on.
    • Once the power light turns off, release the power button.
  5. Your eReader will start the factory reset process. You should see a black screen that tells you the eReader is resetting. Do not turn off your eReader during this process.
O someone is actually reading this? Im just chronicling my journey in case anyone else wants to use ssh password on nia, thanks tho. I have just discovered that the original kobostuff ssh server does work?? Previous attempts resulted kobo freezing each time I sshed but now it works... and im pretty sure i hard reset it too before testing the previous times too but now... im unsure. Still has the same issue of ssh-disabled not remembering password and with it enabled, can no longer log in. So still need implement the above fix。 Seems like repeatedly installing the same packages produces different behaviour after the first time

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.
noobyme is offline   Reply With Quote
Advert
Reply


Forum Jump

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


All times are GMT -4. The time now is 09:26 AM.


MobileRead.com is a privately owned, operated and funded community.