Skip to content

Instantly share code, notes, and snippets.

@tach
Last active May 10, 2021 21:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tach/ad1b1fc486ad053b496d to your computer and use it in GitHub Desktop.
Save tach/ad1b1fc486ad053b496d to your computer and use it in GitHub Desktop.
My tips using Synology NAS (DS215j)

Synology NAS Tips

Shell operation tips

Password of root is same as administrator account as you created on setup.

How to change shell prompt

PS1="\u@\h:\w$ "

See http://unix.stackexchange.com/questions/62350/what-are-special-prompt-symbols-for-busyboxs-sh-support for details.

How to enable users login

Change user's login shell to /bin/ash at /etc/passwd.

vi /etc/passwd

How to enable public key authentication

$ mkdir ~/.ssh
$ chmod 700 ~/.ssh
$ cat >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys
# chmod g-w /volume1/homes/username

How to restart daemons

Synology is using "upstart" as init.

# /sbin/init --version
init (upstart 1.12.1)
Copyright (C) 2006-2014 Canonical Ltd., 2011 Scott James Remnant

This is free software; see the source for copying conditions.  There is NO warranty; not even for
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • START: start servicename
  • STOP: stop servicename
  • RESTART: restart servicename
  • RELOAD: reload servicename

crontabs

Synology runs busybox crond. You should edit crontab as /etc/crontab.

# vi /var/spool/cron/crontabs/username
# restart crond
# m h d m dow user command
*/3 * * * * tach  date > date.log  

rsync remote

  • You must specify --rsync-path=/usr/syno/bin/rsync option to copy data from remote.

MacOSX Tips

Time Machine

See https://www.synology.com/en-us/knowledgebase/tutorials/608 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment