FrostByte 5392 Posted September 19, 2019 Posted September 19, 2019 (edited) Posting this for people who like myself are new to Unix/Synology and want to use WinSCP with write/delete capabilities to have more control when managing their Emby server from a Windows machine. Warning!! Once you've done this you will have administrator access using WinSCP all the way to the root folder of your NAS and you can really mess things up if you're not sure what your're doing. 1. Reset superuser privileges on NAS. This will also stop the sudo command from prompting administrators for a password in order to work with WinSCP. Open DSM Control Panel Click Task Scheduler Create a task General tab: (Uncheck "Enabled") Task Settings tab: text version of "Run command" field (copy/paste the information below to be safe): cat <<EOF > /etc/sudoers Defaults syslog=authpriv root ALL=(ALL) ALL %administrators ALL=NOPASSWD: ALL EOF chmod ug=r,o= /etc/sudoers (Click "OK") Then run the new task you just created*: (Click "Yes") * You may need to run the task again after every DSM update as Synology tends to reset these privileges themselves --- 2. Enable SSH on NAS Open DSM Control Panel Click Terminal & SNMP Terminal tab: (Check "Enable SSH service" and then click "Apply") --- 3. Setup WinSCP Download and install WinSCP on Windows machine https://winscp.net/eng/download.php Allow WinSCP to start Login box: File protocol: SCP Host name: enter the NAS host name or IP address Port number: enter the port number from step 2 User name: "admin" Click "Login" Password: use your admin password Edited October 25, 2021 by FrostByte Added WinSCP advanced settings 3
FrostByte 5392 Posted May 6, 2020 Author Posted May 6, 2020 Basically, it's what is going to allow your admin account to log into the NAS as root which was locked down in DSM6. DSM updates tend to reset this back thus the script is there so you can rerun it after an update. You can use WinSCP without it though
crusher11 1101 Posted May 6, 2020 Posted May 6, 2020 I'm trying to copy my old collections across and I'm getting an "access denied" error which I assume is related though? That step just seems to remove all passwords or something which doesn't seem super secure or anything.
FrostByte 5392 Posted May 6, 2020 Author Posted May 6, 2020 That just prevents sudo from prompting WinSCP for the password. You enter your admin password in the box provided by WinSCP. It doesn't eliminate the need for a password though I would just skip step 1 for now and see what you can/can't do using WinSCP and your admin account without that step.
crusher11 1101 Posted May 6, 2020 Posted May 6, 2020 Like I said I'm getting an "access denied" error trying to copy my collections across.
crusher11 1101 Posted May 6, 2020 Posted May 6, 2020 I tried that, it's still saying "Permission denied" when I try to copy across. I closed WinSCP and reopened it and logged back in after running the script. However, I'm logged in with my username not as "admin", because it denies access when I try to log in as "admin".
Aussiedroid 56 Posted December 14, 2020 Posted December 14, 2020 (edited) Thanks a lot for posting this information @FrostByte I can access the Emby folders again! .. but I am hitting the same issue as @crusher11, even after performing step 1. I can copy files/folders from the /Emby/data/collections directory, but if I try to copy something back it does not allow it (Access Denied). I have tried to edit directly from the NAS too (rather than via Windows PC), but same issue when I try to save. I can copy files to the /Emby master folder but not the sub folders it seems. I am logged in with Admin user, but the owner of the files/folders is the Emby user. I assume this may be why it is preventing me from updating the file? Have tried to log in with the Emby user instead but I am not sure what the password would be as I don't recall ever setting this user up. Would you know of a way to get around this issue? Can I simply perform a password update/reset in DSM for Emby user and then log in via WinSCP with the new password (or could this break the Emby Server)? or Can I grant write access to the Admin user somehow while retaining Emby user as the owner? Do I need to set R/W permissions somewhere else perhaps? As a bit of a novice with this stuff, I am not sure how best to proceed. Appreciate any advice before I inadvertently break something Thank you, AD Edited December 14, 2020 by Aussiedroid
remark3d 4 Posted September 17, 2025 Posted September 17, 2025 (edited) I stumbled upon this thread by accident. Three days ago, I was unsuccessfully trying to solve a problem where I was uploading third-party plugins (*.dll) to the Emby server's plugins folder via SSH, and although they are there, Emby does not accept them because I read that it depends on what permissions they are uploaded with. When I looked at all the default plugins uploaded from Emby, they are under the "Emby" user rights, but mine are under "root." Unfortunately, I couldn't find a way to change them or re-upload them as the "Emby" user. Maybe this is the solution, I'm going to search through this whole thread My Emby is on my Synology DMS7.2 (RS819), (spk) Edited September 17, 2025 by remark3d
Luke 42077 Posted September 17, 2025 Posted September 17, 2025 1 hour ago, remark3d said: I stumbled upon this thread by accident. Three days ago, I was unsuccessfully trying to solve a problem where I was uploading third-party plugins (*.dll) to the Emby server's plugins folder via SSH, and although they are there, Emby does not accept them because I read that it depends on what permissions they are uploaded with. When I looked at all the default plugins uploaded from Emby, they are under the "Emby" user rights, but mine are under "root." Unfortunately, I couldn't find a way to change them or re-upload them as the "Emby" user. Maybe this is the solution, I'm going to search through this whole thread My Emby is on my Synology DMS7.2 (RS819), (spk) Hi, I would imagine a similar process as this would help, no?
remark3d 4 Posted September 17, 2025 Posted September 17, 2025 (edited) Unfortunately, I tried the exact procedure and other possible settings, and just like other users here, when I try to copy anything to the server, I get an "access denied" message. Copying from the server works without any problems. It's a shame. However, I found a similar tool directly within SSH. Midnight Commander is great. Just install the SynoCli package in Synology and then log in to the server in the usual way in Windows. Run cmd in Windows. Enter your login details for the NAS server: e.g. ssh login@192.168.x.x -p 8022 Enter your password. sudo -i Enter your password again. Then enter the command to start Midnight Commander: mc This only works within the server, so you must have everything uploaded somewhere on the server where you have access. However, it copies files with "root" rights. This did not solve my problem, because Emby only accepts plugins when they are saved as Emby users. So I still don't know how to do it. Or change the files in their properties to Emby users. Edited September 17, 2025 by remark3d
remark3d 4 Posted September 17, 2025 Posted September 17, 2025 Finaly I find how change permision of file chown emby EmbyIcons.dll chgrp emby EmbyIcons.dll 1
remark3d 4 Posted September 18, 2025 Posted September 18, 2025 chmod u=rwx notes.txt # Set read, write and execute to currently logged in user chmod g=rw file.txt # set read and write for group chmod o=r file.txt # Set others to read-only chmod u-r # Removes read for user. Hence the minus sign chmod u+w # Adds write for user if it had been there already 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now