# The following commands create a new user and let you choose the password for# the account. You will be able to log into this user through PuTTY just as you# do with your root account, but it won't be able to do as much as the root# account can.useradd btsyncpasswd btsync# The following commands create a new home directory for BTSync and set# ownership of the folder and everything within it to the new btsync account.cd /home/mkdir btsync_homechown -R btsync:btsync /home/btsync_home/cd btsync_home/# Now you will need to either use FileZilla or a similar program to transfer# whichever copy of BTSync fits your Linux distribution into the new# /home/btsync_home/ folder. Make sure that you've extracted everything.# As a safe measure, just re-run the following command to ensure that btsync# has ownership of all the new files.chown -R btsync:btsync /home/btsync_home/# Now log out of the root account and log into the btsync account using the# username btsync and whatever password that you gave the account.# After extracting the btsync files into /home/btsync_home/ run the following# commands to generate a config file and secret key. You will need the secret# key later on, so copy it down../btsync --dump-sample-config > sync.conf./btsync --generate-secretmkdir .sync
{ "device_name": "Valkryst's Server", "listening_port" : 0, // 0 - randomize port/* storage_path dir contains auxilliary app files if no storage_path field: .sync dir created in the directory where binary is located. otherwise user-defined directory will be used*/ "storage_path" : "/home/btsync_home/.sync",// uncomment next line if you want to set location of pid file// "pid_file" : "/var/run/btsync/btsync.pid", "check_for_updates" : true, "use_upnp" : true, // use UPnP for port mapping/* limits in kB/s 0 - no limit*/ "download_limit" : 0, "upload_limit" : 0,/* remove "listen" field to disable WebUI remove "login" and "password" fields to disable credentials check*/ "webui" : {/* directory_root path defines where the WebUI Folder browser starts (linux only)*/// "directory_root" : "/home/user/MySharedFolders/", "listen" : "0.0.0.0:8888", "login" : "btsync", "password" : "btsyncAccountPassword" }/* !!! if you set shared folders in config file WebUI will be DISABLED !!! shared directories specified in config file override the folders previously added from WebUI.*//* , "shared_folders" : [ {// use --generate-secret in command line to create new secret "secret" : "ValkrystSecretKey", // * required field "dir" : "/home/btsync_home/", // * required field// use relay server when direct connection fails "use_relay_server" : true, "use_tracker" : true, "use_dht" : false, "search_lan" : true,// enable SyncArchive to store files deleted on remote devices "use_sync_trash" : true,// restore modified files to original version, ONLY for Read-Only folders// "overwrite_changes" : false,// specify hosts to attempt connection without additional search "known_hosts" : [ "192.168.1.2:44444" ] } ]*/// Advanced preferences can be added to config file.// Info is available in BitTorrent Sync User Guide.}
# Install nano to edit the script with. You can use vim or another similar# program if you wish.sudo apt-get install nano -y# Enter the directory for BTSynccd /home/btsync_home/# Enter the following to begin editing the first script.nano Start.sh# Type in the following two lines exactly as they appear and then press CTRL+X# then press Y and then ENTER to save the file.#!/bin/bash./btsync --config sync.conf# Enter the following to begin editing the second script.nano Stop.sh# Type in the following two lines exactly as they appear and then press CTRL+X# then press Y and then ENTER to save the file.#!/bin/bashpkill btsync# Now that both scripts have been made, enter the following commands to allow# both scripts to be run.chmod +x Start.shchmod +x Stop.sh# To start BTSync just enter the BTSync directory and type..../Start.sh# To stop BTSync just enter the BTSync directory and type..../Stop.shYou can now log into BTSync by either going to www.example.com:8888 or myServerIP:8888 in any web browser. You can log in with the btsync username and password.