In this video, we’re going to dive into some handy terminal commands for your Synology NAS. Let’s kick things off with a few basic commands that can give you a heads up on troubleshooting any issues you might be facing. And then, we’ll wrap things up by showing you a command that’ll let you see which SMB connections are being made to your NAS.
Note: To run a terminal command from your NAS, you’ll need to enable SSH. SSH, or Secure Shell is a protocol that allows an administrator to securely access and execute commands via a command prompt. So because your NAS runs on Linux, you can also use SSH to run and execute commands that are not normally found in Disk Station Manager.
SSH is a great way to manage your NAS, both from your local machine and remotely over the internet. But, as a safety measure, it’s not a good idea to leave SSH enabled all the time. Instead, you should only turn it on when you need to do something specific on your NAS.
This command will display the current configuration of a specific ethernet port on your NAS. The information included in the report, will display the network cards MAC address, its IP address and the Subnet Mask. The same information can be found in Disk Station Manager by opening Control Panel – Network – Network Interface – Edit – IPv4.
ifconfig eth0
  
This command will display the public IP address being used by your Internet connection. This IP address will be the address you need to use in order to remotely access your NAS from the internet. However, you can find the same information by opening a Google search and typing “what’s my IP address”.
curl ifconfig.me
  
The netstat command is used to show both incoming and outgoing traffic on your NAS. So not only will it identify active and inactive connections, it might be helpful when identifying performance issues. While not as detailed. Within the DSM, by selecting the Main Menu button and choosing Resource Monitor. In Performance, and under the heading Network. You can see the amounts of data being sent and received from your NAS.
netstat -an
  
The df command will display information regarding the total space and the space available on the file system of your NAS. So we can use this command to see how much storage space is being used within a volume. In Disk Station Manager, you can find a summary of your storage space by opening the Storage Widget.
df
  
You would use this command to get a more detailed report regarding the CPU being used by your NAS. However in Disk Station Manager, you can find basic information about your CPU by opening Control Panel – Info Centre – General.
cat /proc/cpuinfo
  
The meminfo command provides a detailed report on how the RAM in your NAS is being used. So can be useful when trying to diagnose performance issues, or if you are trying to tweak the performance of your NAS. You can also find basic information regarding RAM utilisation in the DSM, by opening the Resource Monitor widget. Then to see the total amount of RAM in your NAS, try opening Control Panel – Info Centre – General.
cat /proc/meminfo
  
You can use this command to check which version of Linux your NAS is currently running. However we have not seen an option in Disk Station Manager that will provide you with the same information.
cat /proc/version
  
You can use this command to check which version of Linux your NAS is currently running. However we have not seen an option in Disk Station Manager that will provide you with the same information.
uptime -p
  
The top command is a useful diagnostic tool, as it provides a detailed overview of how resources and services are performing on your NAS. You will find the same information in Disk Station Manager, by opening the Main Menu, and selecting Resource Monitor.
top
  
You would use the smbstatus command to check who is connected to the SMB network shares on your NAS. However in order for this command to work, you will need to log in to your terminal session as root. In Disk Station Manager you can find the same information by opening the Main Menu and selecting Resource Monitor. Then from within Resource monitor, if you select Connections – Connected Users, you can see who is connected to your NAS. This will include all SMB connections.
smbstatus
  
 
  
 
	
	
		
	
	
	
 
						
						
	
	
		
Add comment