You may not connect to sshd on LineageOS because of wrong /data permissions:
sshd: Authentication refused: bad ownership or modes for directory /data
- Navigate to your LineageOS 14.1 source dir
- Open file
external/openssh/misc.c
- Find function
safe_path
and comment out this code block: