Category Archives: Synology

Synology and usb share numbering

synology_diskstationWhen you connect a USB device to your Synology diskstation a share is created with a sequence number. The last number assigned (and the device id it is assigned to) is stored in the file /usr/syno/etc/usbno_guid.map.

You can delete devices you no longer use and assign your own numbers here to the USB shares. This is very usefull when you have backup tasks that backup to a specific USB share (like I have).

Share

Add SSH user to your Synology Diskstation

It is best not to SSH into your diskstation with your admin or root account. Create a separate user for this with the appropriate permissions. The steps below outline the procedure to create a new user with SSH access to your diskstation.

1. Create a user through the webinterface, DSM, of your diskstation.

2. Open a (root) terminal on your diskstation and edit the password file:

The last line in this file is your new user. The user cannot login because the shell is set to /sbin/nologin. Change the /sbin/nologin to /bin/ash

Copy the $HOME/.profile to /var/services/homes/[new user]
Edit this .profile file and change the value of $HOME to /var/services/homes/[new user]

3. Now you can login to your diskstation with SSH and username / password:

4. To automate the login procedure create an rsa public/private key pair (this should be done on your local machine; not your diskstation). For this to work be sure to enable the “User home service” on your diskstation (press User Home button on user control panel).

5. Copy the public part of the key to your NAS to $HOME/.ssh

6. Create an authorized key file and set file permission to user-read only:

7. Exit your terminal

8. SSH again to your diskstation; type your passphrase and you are in:

Share
Synology

Synology DiskStation and using a custom SSL certificate

The original post can be found here. For archiving purposes and quick access I have copied this to my blog.

Prepare your Synology DiskStation

openssl synology

  • At first you should generate a temporary work folder. For example /usr/local/ssl/ and cd to this location.

The generation of SSL-certificates is always in two steps. At first you have to generate a certificate authority key. Then you generate a server certificate out of the certificate authority key. The server certificate will be used when starting the webserver. The certificate authority key has to be installed on the client pc.

Generation of the certificate authority key

  1. During the key generation you have to enter a passphrase which you need later to generate the certificates. Generate the key ca.key with the following command (openssl is pre-installed on your synology):
  2. Generation of the key certificate:
  3. Generation of the final certificate authority key (valid 10 years):

Generation of the server-certificate

    1. Generation of the key:
    2. |Generation of the key certificate – most important is the Common Name. It is important that it matches your DNS-Name. Example: name.dyndns.org. You can also use wildcards like *.name.dyndns.org.
    3. Generation of the server certificate:

Installing the files

      1. Change into the Synology certificate folder:
      2. Make a backup folder for the old files:
      3. Copy the old files into the backup folder:
      4. Move the new files to the certificate folder:
      5. The ca.crt has to be installed on the client workstations. For this we copy the file into the folder public.
      6. Restart your Synology Station

Installation of the certificate on the client workstation

Finally the certificate has to installed on the client workstations as a trusted certificate authority. Copy the file ca.crt to the client pc. Install it within windows explorer with rightclick -> install certificate.

Restoring certificates

In case something goes wrong, Synology has supplied an easy way to, not restore, but create a set of new and working certificates. This should restore the certificates if importing certificates from the web manager has failed. If you need a telnet or ssh client use PuTTY.

      • Login as root, using the admin users password, to the Synology NAS drive using telnet or ssh and type the following in the command prompt:
      • Allow the script to finish, and type reboot in the prompt.
      • In a while the NAS drive should have rebooted, and everything should be fine again.
Share
Synology

Subversion installation on your Synology DiskStation

subversionOn the SynologyWiki is an excellent article about installing Subversion on to your synology diskstation. Is is a step by step guide describing all the details for installing subversion on your diskstation.

Integrate Subversion and Visual Studio

You can also integrate SVN with your visual studio environment (almost like TFS). With the software from ankhSVN, for example, you can perfectly integrate SVN and Visual Studio (2008).

Use the Options window to configure the ankhSVN plugin:
image001
The file “app.config” is checked out; other files are also under version control

image002

View all of your pending changes.
image003

All other regular source control options, like banching and merging, labeling, shelving etcetera are all available.

Share