Magisk-Modules-Repo / ssh

ssh
177 stars 34 forks source link

SSHd not running #7

Closed ariel- closed 5 years ago

ariel- commented 5 years ago

Basically what the title says. I've installed the module through Magisk Manager.

Magisk version: v18.1 (18100) Magisk Manager version: v7.0.0 (185) SSH for Magisk version: v0.7

Furthermore if trying to start the service manually on adb shell (as root) it bails without starting:

/sbin/.magisk/img/ssh # sh opensshd.init start
opensshd.init[89]: /sbin/.magisk/img/ssh/usr/bin/ssh-keygen: can't execute: Permission denied
opensshd.init[89]: /sbin/.magisk/img/ssh/usr/bin/ssh-keygen: can't execute: Permission denied
opensshd.init[89]: /sbin/.magisk/img/ssh/usr/bin/ssh-keygen: can't execute: Permission denied
opensshd.init[89]: /sbin/.magisk/img/ssh/usr/bin/ssh-keygen: can't execute: Permission denied
starting /sbin/.magisk/img/ssh/usr/bin/sshd... opensshd.init[89]: /sbin/.magisk/img/ssh/usr/bin/sshd: can't execute: Permission denied
opensshd.init: Error 126 starting /sbin/.magisk/img/ssh/usr/bin/sshd... bailing.
ariel- commented 5 years ago

Well, apparently the distributed binaries lack the required execute bit. DIY in case anyone has the same problem: # chmod u+x /sbin/.magisk/img/ssh/usr/bin/rsync /sbin/.magisk/img/ssh/usr/bin/raw/*

Leaving the issue open incase this is upstream problem instead local

gu5t3r commented 5 years ago

SSHD is not starting/running because execute permission is not set for files in raw directory

Missing in config.sh after copying files and making links: set_perm_recursive $MODPATH/usr/bin/raw 0 0 0755 0755 config_fixed.txt

ariel- commented 5 years ago

Shouldn't the recursive part be well, recursing directories and setting permissions on $MODPATH and subdirs tough?

gu5t3r commented 5 years ago

Shouldn't the recursive part be well, recursing directories and setting permissions on $MODPATH and subdirs tough?

set_perm_recursive $MODPATH 0 0 0755 0644 command is run before files are moved and links created. also, 644 is rw-r--r-- thus no execute permission is set on binary files. there is no need to set execute permission on all files in $MODPATH, just the raw directory and openssh.init script

D4rCM4rC commented 5 years ago

This was kind of a dumb mistake: I used chmod -r 755 instead of chmod -R 755. Strangely, it still worked on my device so I didn't notice it.

Should be fixed in the just released v0.8

Alex2357 commented 4 years ago

This was kind of a dumb mistake: I used chmod -r 755 instead of chmod -R 755. Strangely, it still worked on my device so I didn't notice it.

Should be fixed in the just released v0.8

I'm new to magisk, I'm on latest Magisk-v20.3.zip & using SSH for Magisk v0.10 and still have the problem sshd is not starting on boot. It works fine if I start it

/sbin/.magisk/modules/ssh/opensshd.init start                                                                                 
starting /sbin/.magisk/modules/ssh/usr/bin/sshd... done.

after I did this

/sbin/.magisk/modules/ssh # chmod -R 755 .

I was able to start manually

/ # ./sbin/.magisk/modules/ssh/service.sh
starting //sbin/.magisk/modules/ssh/usr/bin/sshd... done.

But it still is not starting on boot automatically.