Jump to content

Tutorial: SSH into Synology NAS with Useful Examples


Carlo

Recommended Posts

Open DSM as usual in a web browser.  Once logged in Open Control Panel.
Click on the Users & Groups menu on the left.
image.png

Most likely the admin account will be deactivated. We are going to activate it for our use as well as change the password (if we do not remember it).
Click on the admin username to highlight it, then click the edit tab.
image.png

Click the box above next to "Deactivate this account" if needed so there is not a checkbox.
If you do not remember the admin password, click the Change Password button above to get this:
image.png

Type a secured password in both places and click the Save button. Use lower and uppercase letters, a number or two as well as a special character.
Click the Save button on the user screen as well to save our changes and we should now have a valid activated admin account to use for SSH.

Next, we need to enable SSH access to the NAS.
We do this easily by clicking on the left menu "Terminal and SNMP"
Make sure the checkbox is enabled for SSH and set the port to 22 if needed.

image.png
Click the Apply button to save this info.

You will need to know the IP address of your NAS. If you're not sure, click the Network menu item, then the Network tab for a similar screen to this:
image.png

You might see a "bond" or individual NIC cards which isn't that important as we just need to know the IP address.

We are now ready to SSH into our NAS. You can use a terminal from a Mac or Linux or a command shell on Windows 10 & 11.
In Windows hold with Windows Key while pressing R
Type cmd and click the OK button.
From your shell or terminal type you will launch an SSH session with the following command.  Change 10.69.0.31 to use the IP of your NAS.
SSH admin@10.69.0.31
If this is the first time you have SSHed into your NAS you may be asked to save a secured encryption key or similar so answer by typing yes (3 letters), not just y.
You will now be prompted to type your admin password. Type it and hit enter.

Go Super User
Once logged in type sudo -i
image.png

Navigate to Emby Server App Location
We can now navigate to the top level directory of our Emby Server using:
cd /volume1/@appdata/EmbyServer
we can view the directory using:
ls -l
image.png

Change Directory
If we wanted to change directory to the plugins folder we could do this:
cd plugins
or
cd /volume1/@appdata/EmbyServer/plugins

List Directory's Files and Subdirectories
To view items we can do ls -l
image.png

Deleting/Removing File
If there was a plugin name that is not wanted you could delete it using the rm name followed by the dll name (case matters).
If you had 2 dlls you wanted to remove named helper.dll and EmbyHelper.dll you could remove these using:
rm helper.dll
rm EmbyHelper.dll

If you had a file named EmbyScripterX.xml you wished to remove that was in the config folder you could change directory up to the parent from the plugins directory using:
cd ..
Then to the config directory with:
cd config
You could now view this directory contents with
ls -l
To delete the file mentioned above you would type:
rm EmbyScripterX.xml
If you had a file in the config directory name ReadyState.xml that you wanted to remove you would use:
rm ReadyState.xml

 

Listing the Data Directory and all your Emby Database Files
If you wanted to see how big your database files are you could navigate back up to the parent and then to the data directory with:
cd ..

cd data
or

cd /volume1/@appdata/EmbyServer/data

ls -lh
(note we added an h to the above command line to give us human readable file sizes)

image.png

If you had an Emby Server that starts and immediately stopped and wanted to see what the latest log file contains you could navigate to the logs directory with:
cd ..

cd logs
or

cd /volume1/@appdata/EmbyServer/logs

ls -lh
image.png

View the current Log File while Emby is Running
You can display the whole file quickly using:

tail -f embyserver.txt (ctrl-c to quit)

Copy a File to a New Location
You could also copy the log file to a location you can access easily in a browser using
cp embyserver.txt /volume1/homes/admin

image.png

Viewing the Admin Password Reset File
Knowledge Base: https://emby.media/support/articles/Admin-Password-Reset.html

cat /var/lib/emby/passwordreset.txt
or
cat /volume1/@appdata/EmbyServer/passwordreset.txt

Finishing Up
When you are finished close your SSH connection.
Reverse the first couple steps we did by deactivating the admin account until we need it again.
We can also turn off SSH again until we need it!

I hope you found the tutorial and examples useful,
Carlo
 

 

Edited by Carlo
  • Like 3
  • Thanks 3
Link to comment
Share on other sites

ItsDrBob

This was a great help to me because I don't SSH much. Reminder to all, there is a space between cd and  /volume1/@appdata/EmbyServer and case matters. Also if copying the log file to a shared directory there is a space between Embyserver.txt and  /volume1/[foldername]. Once I deleted the files identified by the Emby red banner link, and created new Emby passwords, my Emby server stayed running.

Thanks Carlo for stepping this out!

  • Like 2
Link to comment
Share on other sites

Glad you found it helpful.

I tried to give both the command in case someone wanted to copy/paste it as well as show screen shots. I think the screen shots show spaces a bit better.

 

  • Like 1
Link to comment
Share on other sites

VicSupaNov

My synology emby want working for a few days and I waited until I found a solution,

I followed this process as best as I could execpt the only matching file I found was the Emby.Helper.dll .

I didnt find any of the other files mentioned here (Readystate.xml and EmbyScripterX.xml)  or elsewhere. i saved a copy of the log.

but then I looked again and realized I was supposed to be in /volume1/@appdata/EmbyServer/plugins/configurations#

to find those 2 files.

I was in /volume1/@appdata/EmbyServer/config#

which is why i couldnt find them. just posting this in case someone else made this silly mistake.

 

hopefully it works again after this

Link to comment
Share on other sites

jedtrek
12 hours ago, VicSupaNov said:

My synology emby want working for a few days and I waited until I found a solution,

I followed this process as best as I could execpt the only matching file I found was the Emby.Helper.dll .

I didnt find any of the other files mentioned here (Readystate.xml and EmbyScripterX.xml)  or elsewhere. i saved a copy of the log.

but then I looked again and realized I was supposed to be in /volume1/@appdata/EmbyServer/plugins/configurations#

to find those 2 files.

I was in /volume1/@appdata/EmbyServer/config#

which is why i couldnt find them. just posting this in case someone else made this silly mistake.

 

hopefully it works again after this

@Carlocan you confirm?  I was having the same issue as above, but everything I've read says those two files should be located in the "EmbyServer/config" folder vs. the "EmbyServer/plugins/configurations" folder.

Also, thank you for the great write up on this.

  • Thanks 1
Link to comment
Share on other sites

It should be as written using config.
But I can say it's fine to remove any files named that regardless of location so feel free to check both locations. :)

Link to comment
Share on other sites

  • 2 weeks later...
1095906869

非常感谢。我在 /volume1/@appdata/EmbyServer/plugins/configurations#找到那两个文件

  • Like 1
Link to comment
Share on other sites

1095906869
On 5/29/2023 at 9:38 AM, VicSupaNov said:

我的 synology emby 想工作几天,我一直等到找到解决方案,

我尽可能地遵循了这个过程,我发现唯一匹配的文件是 Emby.Helper.dll 。

我没有找到这里提到的任何其他文件(Readystate.xml 和 EmbyScripterX.xml)或其他地方。我保存了一份日志副本。

但后来我又看了一遍,意识到我应该在 /volume1/@appdata/EmbyServer/plugins/configurations#

找到那两个文件。

我在 /volume1/@appdata/EmbyServer/config#

这就是为什么我找不到他们。只是张贴这个以防其他人犯这个愚蠢的错误。

 

希望在此之后它能再次工作

非常感谢。我在 /volume1/@appdata/EmbyServer/plugins/configurations#找到那两个文件

@Carlo

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
5 minutes ago, luundblad said:

im on a new setup with few movies atm, why do i only have theese folders?  image.png.611c51c66aa1fb639ec1ee4fa652b895.png

HI, what folder specifically are you questioning? 

Link to comment
Share on other sites

luundblad
14 minutes ago, Luke said:

HI, what folder specifically are you questioning? 

Hi! See my question here at the end, trying to find something to do that


O

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...