Login with Synology

Added by Jim Richards about 5 years ago

I installed the package for my synology NAS. It is running and assigned to 192.168.3.100:9981.However, when I go to set up Tvheadend, it asks for authentication

"The server at http://192.168.3.100:9981 requires a username and password. The server says: tvheadend."

I can't log in with any username/pw combo. I'm not the greatest with linux, but I can telnet into the synology with my windows machine.

Any help appreciated! Thank you.


Replies (25)

RE: Login with Synology - Added by Thomas Guldener about 5 years ago

Try it with your Synology Admin Account

RE: Login with Synology - Added by olosi naco about 4 years ago

Hello I have the same issue, even using the synology admin account I cannot enter.... should I configure anything... please help me out !

RE: Login with Synology - Added by Randy Hunt over 2 years ago

I know this is an old thread, but it's also the first one that shows up in my searching for an answer to this problem.
Anyway, I figured it out on my own, but I thought I'd post the answer.
When installing the tvheadend Synology package and it asks you for a user name, make sure you enter one that doesn't already exist on your NAS. I looked into the code, and it's apparently trying to run "adduser" which fails if the user already exists. Apparently the package isn't watching for this error and continues to install; unfortunately, now no users can access it.

I recommend using "tvheadend" since you'll not likely have any conflicts with existing users.

RE: Login with Synology - Added by Stephane Triomphe over 2 years ago

Hi,
As I had the same issue recently on a DS716+ with version 4.1.1334, and the method above was not working, I propose another solution :

You could add a superuser file in the tvheadend dir(/volume3/@appstore/tvheadend-testing/var/ for example):

$ more superuser {
"username": "xbmc",
"password": "xbmc"
}

Not sure it's the best but at least it works. Once connected, you can edit the user access correctly. I take the idea here :
https://tvheadend.org/boards/5/topics/11233

PS : I reinstall the app, and then I was unable to reuse this method.
Another method is to change temporarily the start command line. Edit this file :
nano /var/packages/tvheadend-testing/scripts/start-stop-status

And add -C to start line (stop the package before):

start_daemon () {
${TVHEADEND} -C -f -u ${USER} -c ${INSTALL_DIR}/var -p ${PID_FILE} -l ${LOG_FILE}
}

Start you package, webUI should start without any user request. Add a user and password from webui.
Then remove the -C for the command line.

RE: Login with Synology - Added by Frank Zürn over 2 years ago

Hi,
I found one more problem with the start-stop script at least in the cedarview package
The user has changed to tvheadend-40, but in the package there is still tvheadend-4.0 named.
For me this did result in high CPU-Load and huge IO-Traffic leaving the WebUI not usable.

Maybe Dierkse can fix this ?!?

RE: Login with Synology - Added by Frank Zürn over 2 years ago

Hi,
I also found out that the config file was not working, so the Entry in the Synology Main Menu was corrupted.
I made a new config, that seems to work:

".url": {
"com.synocommunity.packages.tvheadend-4.0": {
"title": "Tvheadend 4.0",
"desc": "Tvheadend Web UI",
"icon": "images/tvheadend-4.0-{0}.png",
"type": "url",
"protocol": "http",
"url": "/",
"port": "9981",
"allUsers": true,
"grantPrivilege": "local"
}
}
}

It also simplifies the config as it doesn't require the cgi.page

RE: Login with Synology - Added by Prof Yaffle over 2 years ago

Maybe not wholly-related, but this is still one of the top hits so it's as good a place as any.

It seems, from an IRC conversation, that each new Synology tvheadend package installs into a new directory, and assumes to run under a username equal to the name of that package. Combine that with some packaging issues that potentially set ownership of the access control entries as read only for "root", then start a package called "tvheadend-40" as user "tvheadend-4.0", and you can see the fun.

So: check permissions, check the UID of the running user, check the startup scripts.

Or look here, as it seems that those nice folks over at Sundtek (well, one of them, at least) has created a package that will help resolve it on any version:

https://forum.synology.com/enu/viewtopic.php?f=190&t=115406

RE: Login with Synology - Added by Michael 47 over 2 years ago

Thank's for all this indications it's work for me (DS1515+ DSM6) and TVheadend (testing) 4.1

With the follow steps

install pkg from syno.dierske.nl

don't start the server

sudo chown -R xxxx:users /volume1/@appstore/tvheadend-testing/

sudo chmod -R 775 volume1/@appstore/tvheadend-testing/var/

add -C to/var/packages/tvheadend-testing/scripts/start-stop-status

start TVheadend

create users etc

modify back start-stop-status file

Merci
Michael

RE: Login with Synology Create manually tvheadend-testing user - Added by Michael 47 over 2 years ago

hi
(TVheadend-testing 4.1 1923-2 and DSM 6.0)
It's works but when I change TVheadends settings and restart TVheadend i go back to the 401 page.

I try some user configurations, user xxx:users , system:users sysyem:system and I also try to create (in the DSM WEB Interface) a TVheadend-testing user (like in the start.batch)
The the folder owner (fresh install) was ok, the permission also, but after settings changes and restart back to 401 page.

Also I don't found TVheadend-testing in the applications list for user/groups permissions.

What can I do for

  • create manually on OS Level the user tvheadend-testing user
  • add TVheadend-testing to the apllication list

Merci
Michael

RE: Login with Synology - Added by Seb DL over 2 years ago

Hello,

I have the same problem on DSM 6.0 (DS713+).

Impossible to login to Tvheadend testing or stable version (4.0).

No user created during installation (TVheadend-testing user ?).

someone happens to connect to TV headend on DSM 6.0 ?

Thanks

RE: Login with Synology - Added by Stephane Triomphe over 2 years ago

Hi,

It works for me with DSM6.0 and DS716+, TvheadEnd testing version.
But I did not make a full new install. It's based on my previous install (with DSM5). And I already fix some stuff before (change user, etc).
Just to be clear, the user in TvHeadEnd are not the one in DSM.
Users in DSM are just used to allow TvHeadEnd to run.
Once TvHeadEnd is started and running, you can access to login page, then you need to enter a TvHeadEnd user, one recorded in the app, not the one from DSM.

If you have trouble to login in TvHeadEnd, you can try to add -C to start command line, as proposed by Michael 47.
The interface to change TvHeadEnd users is not very clear. If I remember correctly, one mistake I made is to not save correctly the changes I made. Be carreful also, because you have a user tab, and a password tab. Try to create multiple users, just to be sure that at least one will work :). And set all of them as admin. Once correctly connected, you could remove the unneeded ones.

Regards.

RE: Login with Synology - Added by Michael 47 over 2 years ago

Hi
I think DSM5 is the trick. With DSM 6.0-7321 Update 3 for me nothing works more ,
not the install
not any workaround. The -C workaround cancel with error message.

And the DSM security check has marked a Sundtek script (I give a try to the driver apps install, uninstall) as malicious.

Ciao

Michael

RE: Login with Synology - Added by Seb DL over 2 years ago

Ok thanks. I think to downgrade to DSM 5

RE: Login with Synology - Added by Michael 47 over 2 years ago

Downgrade to 5x.
I've 13To data on my Nas, I don't like the idea. But i've also a "working" TVheadend server 4.05 on a OSMC box (without upgrades) for 99£.

I'm not shell coder, but sometimes I can read log files. I've found a first error line

/var/packages/tvheadend-testing/scripts/installer: line 30: synouser: command not found

I will open a new thread here and another in the synology forum.

Michael

RE: Login with Synology - Added by Stephane Triomphe over 2 years ago

I think it's not possible (not easy) to downgrade a syno product.

Synouser is a special syno command to create users compatible with DSM.
In older release of TvHeadEnd, a classic linux command was used to create the TvHeadEnd-Testing user. It generates troubles, because the group was not set correctly, and user Id was not above 1024 (so not visible in DSM).
I think the install script was changed to use synouser, and it should be more a good point than a problem.
The error line you have suggests that synouser cmd doesn't exist. Funny. Maybe there is more a path trouble, because this command is still the one recommanded by synology. (I know for example that unzip cmd disapeared, but it should not be the case for synousr).

My suggestion : if the install fails to create the user, try to create it using DSM : "tvheadend-testing"
It should match the user used in the start script (/var/packages/tvheadend-testing/scripts/start-stop-status):
USER="tvheadend-testing"
GROUP="users"
Normally, if created by DSM, the user should be in users group.

Now check that the TvHeadEnd files have the right user. For me, they all are : tvheadend-testing users
If not, you could change them using :
chown -R tvheadend-testing:users /volume1/@appstore/tvheadend-testing

With the user created, and the correct rights, TvHeadEnd should be able to write it's own user files (located here : /volume1/@appstore/tvheadend-testing/var/ in accesscontrol and passwd)

As TvHeadEnd is working for me, I can't test it, but it's part of the changes I made in DSM5 when I've got other access troubles. use it only if you know what you're doing even if it should not make things worst.

RE: Login with Synology TVheadend 4.01 installer - Added by Michael 47 over 2 years ago

I'm not shell coder,also i try to read log
line 30 and after is

      # Create user
    synouser --add "${USER}" "${PASS}" "${DNAME} User" 0 "" 0

    wizard_password=`echo -n "TVHeadend-Hide-${wizard_password:=admin}" | opens$

    # Edit the configuration according to the wizard
    sed -i -e "s/@[email protected]/${wizard_username:=admin}/g" ${INSTALL_DIR}/var/acc$

    sed -i -e "s/@[email protected]/${wizard_username:=admin}/g" ${INSTALL_DIR}/var/pas$
    sed -i -e "s/@[email protected]/${wizard_password}/g" ${INSTALL_DIR}/var/passwd/341$

    # Correct the files ownership
    chown -R ${USER}:users ${SYNOPKG_PKGDEST}

    chown -R ${USER}:users ${INSTALL_DIR}/var/accesscontrol/*
    chmod 700 ${INSTALL_DIR}/var/accesscontrol/*

    chown -R ${USER}:users ${INSTALL_DIR}/var/passwd/*
    chmod 700 ${INSTALL_DIR}/var/passwd/*

    sed -i 's/"digest": true/"digest": false/g' ${INSTALL_DIR}/config

    exit 0

Something here is wrong, but ...

RE: Login with Synology - Added by Michael 47 over 2 years ago

This morning come a new package 4.1 1943-2

same user error . The synopkg.log is joint.

the syno user command

  # Create user
    synouser --add test0810 pwd 'openssl rand -base64 32' "Test0810" User 0  0 

DNAME="Tvheadend-Testing"  Full name
USER="tvheadend-testing"   User name 
PASS=`openssl rand -base64 32' password generation

I try on terminal (without password generator)

sudo  synouser --add test0810 "ich" "Test0810" User 0  0 

error message

expire value is invalid.

Michael
Edit: i found another log bash_err.log

Apr 28 08:26:05 HDreseau4 sh: BASH_ERR: internal_error [ (31680)"synoscgi_SYNO.Core.Package.Installation_1_install" -> (32159)"/bin/sh /var/packages/tvheadend-testing/scripts/postinst" -> (32170)"/bin/sh /var/packages/tvheadend-testing/scripts/postinst" ] /var/packages/tvheadend-testing/scripts/installer: line 30: synouser: command not found
Apr 28 08:29:29 HDreseau4 sh: BASH_ERR: internal_error [ (2370)"synoscgi_SYNO.Core.Package.Uninstallation_1_uninstall" -> (2780)"/bin/sh /var/packages/tvheadend-testing/scripts/preuninst" -> (2786)"/bin/sh /var/packages/tvheadend-testing/scripts/preuninst" ] /var/packages/tvheadend-testing/scripts/installer: line 61: synouser: command not found
Apr 28 08:30:43 HDreseau4 sh: BASH_ERR: internal_error [ (5233)"synoscgi_SYNO.Core.Package.Installation_1_install" -> (5501)"/bin/sh /var/packages/tvheadend-testing/scripts/postinst" -> (5509)"/bin/sh /var/packages/tvheadend-testing/scripts/postinst" ] /var/packages/tvheadend-testing/scripts/installer: line 30: synouser: command not found
Apr 28 08:37:01 HDreseau4 sh: BASH_ERR: internal_error [ (10190)"synoscgi_SYNO.Core.Package.Uninstallation_1_uninstall" -> (10486)"/bin/sh /var/packages/tvheadend-testing/scripts/preuninst" -> (10492)"/bin/sh /var/packages/tvheadend-testing/scripts/preuninst" ] /var/packages/tvheadend-testing/scripts/installer: line 61: synouser: command not found

synopkg log 28-04-16-9-50 - Install log TVHeadend 4.1.1943-2 (23.7 KB)

RE: Login with Synology - Added by Michael 47 over 2 years ago

It's work's now with 4.1.1945-1. Many thanks to J.Dierske.

Michael

RE: Login with Synology - Added by Rene Arts over 2 years ago

Just installed 4.1.1996-1 and it seems broken again. Going to set the rights manually, see if that helps.

RE: Login with Synology - Added by Michael 47 over 2 years ago

Broken again ??

First install , never login like "TVHuser" ??

RE: Login with Synology - Added by Rene Arts over 2 years ago

No, yesterday I updated it from the previous version. I am using J.Dierkses tvheadend-testing repository.
I'm considering reinstalling it, though have to find an easy way to save the configuration first :)

RE: Login with Synology - Added by Michael 47 over 2 years ago

take a look to
to @appstore/tvheadend-testing/var/config file

>>  -rw------- 1 tvheadend-testing users    899 May  3 12:53 config
>
>
>>  {
>>          "version": 23,
>>          "full_version": "4.1.1945",
>>          "server_name": "Tvheadend",
>>          "uilevel": 2,
>>          "uilevel_nochange": false,
>>          "ui_quicktips": true,
>>          "digest": true,
>>          "cookie_expires": 7,
>>          "dscp": -1,
>>          "descrambler_buffer": 9000,
>>          "parser_backlog": false,
>>          "language": [
>>                  "fre" 
>>          ],
>>          "epg_compress": true,
>>          "info_area": [
>>                  "login",
>>                  "storage",
>>                  "time" 
>>          ],
>>          "language_ui": "fre",
>>          "theme_ui": "blue",
>>          "tvhtime_update_enabled": false,
>>          "tvhtime_ntp_enabled": true,
>>          "tvhtime_tolerance": 5000,
>>          "prefer_picon": false,
>>          "chiconscheme": 0,
>>          "piconscheme": 0,
>>          "satip_uuid": "d5d1f1a7-55d7-5d5f-73f3-2d690fa48d9b",
>>          "satip_rtsp": 0,
>>          "satip_weight": 100,
>>          "satip_remote_weight": true,
>>          "satip_descramble": 1,
>>          "satip_rewrite_pmt": false,
>>          "satip_muxcnf": 0,
>>          "satip_dvbs": 0,
>>          "satip_dvbs2": 0,
>>          "satip_dvbt": 0,
>>          "satip_dvbt2": 0,
>>          "satip_dvbc": 0,
>>          "satip_dvbc2": 0,
>>          "satip_atsct": 0,
>>          "satip_atscc": 0
>>  }

Le mardi 03 mai 2016 à 12:13 +0000, J. Dierkse a écrit :

"digest" is set to true, indeed.
This must be false, and you'll have to restart the package
afterwards.

RE: Login with Synology - Added by Rene Arts over 2 years ago

Thanks, though not yet needed.

Just had a look at the ownership of the files. The update screwed the user permissions: some files were owned by tvheadend, some by tvheadend-testing. Chmodded them all to tvheadend-testing and it all works again.

RE: Login with Synology - Added by Stephane Triomphe over 2 years ago

No trouble on my side with 1996 version.

RE: Login with Synology - Added by Janko L. over 2 years ago

Hi,

I have to refresh this thread. Yesterday my Synology did an Update to version "DSM 6.0.1-7393 Update 1". Tvheadend is still on version 4.0.8-1. And now I'm asked for a user to login again. I tried:

Adding the "-C" to the start_stop_status script:

start_daemon () {
${TVHEADEND} -C -f -u ${USER} -c ${INSTALL_DIR}/var -p ${PID_FILE} -l ${LOG_FILE}
}

and also creating a "superuser" file in the tvheadend/var dir:

{
"username": "xbmc",
"password": "xbmc"
}

But both didn't help.

Is there anything else, I could check/try?

(1-25/25)