Transmission linux console start

INT 21h

Transmission в консоли Linux

Выглядит круто. Устанавливается командой sudo apt-get install transmission-daemon transmission-cli transmission-remote-cli

Демон стартует в фоне при запуске системы и является всего-лишь набором потоков для раздачи торрентов. Для управления ими он предоставляет специальное API, которые можно дергать программами из пакета transmission-cli. Также демону доступны такие опции как вход по логину и паролю. Я запускаю демона и клиентскую программу локально и поэтому не стал использовать эту функцию.

Любые настройки нужно делать только при остановленом демоне, т.к. при остановке он перезаписывает конфиг. Если изменили настройки прямо во время работы, то придется сделать reload сервису. Конфиг по умолчанию лежит тут /etc/transmission-daemon/settings.json. Настройки, на которые стоит обратить внимание:
«rpc-authentication-required»: false,
«rpc-bind-address»: «127.0.0.1»,
«rpc-enabled»: true,
«rpc-password»: » «rpc-whitelist»: «127.0.0.1»,
«rpc-whitelist-enabled»: true,

Вот эти 2 параметра нужно обязательно изменить под себя. Пока раздача скачана не полностью она должна где-то храниться. По умолчанию делается всякая херня.

«incomplete-dir»: «/var/tmp»,
«incomplete-dir-enabled»: false,

Вы видите, что пароль задан. Он не пустой даже не смотря на то, что он пустой 🙂 К нему, очевидно, добавляется соль, хешируется и сохраняется. Стираете это значение чтобы оно было пустым. Если пароль все-таки будет, то пишете его туда прямо в голом виде. При старте демон прочитает файл настроек и перезапишет его, где ваш пароль уже будет заменен хешем. Итак, я выключил авторизацию, сделал управление доступным только локально, забиндив к 127.0.0.1, включил rpc чтобы управлять из консоли и разрешил подключения с локального ip адреса. Ваще ниче сложного.

Теперь можно подключиться к этому демону командой и посмотреть на пустой экран 🙂

transmission-remote-cli -c 127.0.0.1

Чтобы там что-то появилось нужно создать раздачу или скачать чью-то.

Пожалуй, начну с создания. Допустим, что вы используете демона на вашем домашнем NAS, который раздает файлы по http или ftp. Все файлы у вас сложены по разным директориям, которые как раз подходят для раздачи через торренты. Например, дистрибутивы Linux для 32 и 64 битных систем. Для автоматизации напишем скрипт, который сначала создаст torrent файл, а потом скормит его демону transmission. Поскольку у меня есть собственный torrent трекер я буду использовать его. Назовем скрипт transmission-create .

#!/bin/bash
transmission-create -t http://torrent.opentomsk.net:6969/announce -o $1 $2
transmission-remote -a $1 -w $2/../

Запускаем скрипт, указав название создаваемого торрент файла и директории где они лежат. Вторая строка скрипта добавит созданный файл в демона transmission и в качестве директории для скачивания ту самую диру, откуда были взяты файлы при создании. Таким образом transmission увидит, что файлы уже есть на месте, проверит хеши и начнет раздачу.

root@opentomsk:/opt# ./transmission-create lazarus-1.4-release.torrent /opt/ftp/apps/development/freepascal_lazarus/1.4/
Creating torrent «lazarus-1.4-release.torrent» . done!
localhost:9091/transmission/rpc/ responded: «success»

С созданием торрент-файлов и раздач закончили. Теперь можно сделать скрипт для скачивания торрентов на ваш NAS. Назовем его transmission-get .

#!/bin/bash
transmission-remote -a $1 -w $2

Ну тут совсем все просто. Первым параметром указывается URL до торрент файла или путь до него, если он уже лежит локально. Второй параметр это директория куда нужно скачать его. URL лучше брать в кавычки, т.к. он может содержать управляющие консолью символы.

root@opentomsk:/opt# ./transmission-get «http://ftp.opentomsk.net/distr/ubuntu/15.04/ubuntu-15.04-all.torrent» /opt/ftp/distr/ubuntu/15.04/

Вы настроили демона и теперь начались проблемы с правами. То туда записать не может, то от туда прочитать… В общем, вам лень разбираться с правами доступа и появилась необходимость стартовать демона с правами рута. Открываем /etc/default/transmission-daemon и добавляем в конец строку USER=root . Теперь на права можно смело забивать, т.к. файл сможет сохраняться в любое желаемое место 🙂 Напоминаю, что если это не ваш домашний NAS с доступом только из локалки, то очень делать это довольно небезопасно.

Читайте также:  Windows shortcuts show all windows

Источник

Transmission-daemon

Содержание

Основное отличие данной программы от Transmission заключается в том, что это демон, а значит работает в фоне и всегда.

Установка

Настройка

Главный минус работы с ненастроенным transmission-daemon- это невозможно им управлять, потому что по умолчанию к нему нельзя подключаться web интерфейсом или сторонними программами. При настройке необходимо помнить, что конфигурационный файл нельзя менять, пока служба transmission-daemon работает, потому что при остановке он восстановит его первоначальное (которое было при запуске) состояние и все ваши старания накроются медным тазом. Поэтому ВСЕГДА перед началом настройки необходимо остановить службу

Смысл описанных ниже телодвижений — заставить службу работать от имени пользователя, а значит и создавать скачиваемые файлы, владельцем которых сразу будет наш пользователь, что убережёт нас от последующих проблем с доступом к файлам.

Переносим папку с основными файлами в домашнюю папку пользователя

И в строке CONFIG_DIR прописываем путь до папки с файлами настройки.

Принуждаем работать службу от нашего пользователя:

если используется init.d

Меняем setuid (NAME) debian-transmission и setgid (USER) debian-transmission на имя своего пользователя.

если используется systemd

Меняем значение переменной User за свое

затем делаем перезагрузку юнитов

Настройка settings.json

Пример файла с настройками

В полях rpc-username и rpc-password задается логин и пароль соответственно, а так же в поле rpc-whitelist дописываем свой внешний IP если есть, чтобы получить доступ к Transmission на сервере. Если у Вас динамический IP, то можно отключить проверку IP. Для этого нужно в поле rpc-whitelist-enabled поставить значение false. По окончании всех настроек запускаем службу

Источник

>_ Transmission CLI User Guide

When it comes to BitTorrent clients, there are a lot to choose from. After using uTorrent for a while I found myself looking for a lightweight (and ad-free) alternative. In some cases, you will find that a heavy desktop app can be replaced by a simple command line alternative and Transmission CLI offers just that.

Transmission is a popular cross-platform BitTorrent client that comes in a variety of flavours, including native Mac and GTK+ versions with a desktop GUI familiar to anyone who has used uTorrent.

There is also a command line interface for Transmission which turned out to be perfect for my occasional BitTorrent requirements.

This guide will run you through the basic usage of the terminal client.

Installation

Transmission is the default BitTorrent client in many Linux distributions and transmission-cli can be found in most official repositories.

For OSX, Transmission CLI can be installed with the excellent package manager Homebrew:

The installation will include a set of command line utilities but for the scope of this tutorial we will cover just two of these: transmission-daemon and transmission-remote.

transmission-daemon

This is the Transmission client itself, when a Transmission session is started it will run quietly as a background process and can be controlled with the remote utility.

transmission-remote

This is the control utility used for adding and removing torrents.

Configuration

Out of the box, the default settings should be fine for simple use. Although one thing you may want to update is the download directory for completed torrents. This can be set with the following command:

To confirm the directory location you can run this command which will print out the current settings:

For a full list of available configuration options, check out the manual page.

Start

The first thing you will want to do is start the Transmission session, you can do this by simply running the daemon:

Adding a Torrent

To add a torrent you will use transmission-remote and pass the torrent file location as a parameter with the -a option. The file location can either be a local path to a downloaded torrent file or a direct URL to the online location.

Magnet links are also supported and can be added in exactly the same way.

Download Status

The status of your downloads can be checked at any time by using the list -l command:

Читайте также:  Нельзя установить windows с флешки

This will display a list of loaded torrents and the status of each download.

Removing a Torrent

It is always good to seed a torrent for as long as possible, but when your housemate is knocking on your door and complaining about the bandwidth, here is how to remove the torrent.

In the download list output you can see that each loaded torrent has an ID in the left-hand column. You can use this ID to select a torrent by using the -t command followed by -r to remove.

You can select multiple torrents by passing comma separated ID’s.

Alternatively you can also pass all to remove everything.

Final Tip

Tip: alias transmission-remote to tsm

To save a bit of time I can recommend setting up a shorter alias for transmission-remote:

Now you can spend less time typing and more time downloading.

I hope this guide can encourage you to try out the command line version of Transmission and help you get started with the basics.

Источник

Transmission

Transmission is a light-weight and cross-platform BitTorrent client.

Contents

Installation

There are several packages available to install Transmission with:

Configuring the GUI version

Both GUI versions, transmission-gtk and transmission-qt, can function autonomously without a formal back-end daemon.

GUI versions are configured to work out-of-the-box, but the user may wish to change some of the settings. The default path to the GUI configuration files is

A guide to configuration options can be found on Transmission’s Github.

Transmission daemon and CLI

The commands for transmission-cli are:

transmission-daemon: starts the daemon. transmission-remote: invokes the CLI for the daemon, whether local or remote, followed by the command you want the daemon to execute. transmission-show: returns information on a given torrent file. transmission-create: creates a new torrent. transmission-edit: add, delete, or replace a tracker’s announce URL. transmission-cli: (deprecated in favor of transmission-remote) starts a non-daemonized local instance of transmission, for manually downloading a torrent. tremc: (requires tremc-git AUR ) starts the curses interface for the daemon, whether local or remote.

Starting and stopping the daemon

Transmission’s daemon can be run:

  • As the user transmission, by starting/enabling transmission.service . The user can be changed as explained in #Choosing a user.
  • As your own user, by running under your user name:

Starting the daemon will create an initial configuration file. See #Configuring the daemon.

The daemon can then be stopped with:

An alternative option to stop Transmission is to use the transmission-remote command:

Reducing journal spam

Running transmission-daemon can lead to a lot of unwanted journal entries. Output can be filtered by starting it with a small wrapper script. The following example also provides some notifications:

Run only while connected to network

Netctl

It may be desirable to run transmission only on certain networks. The following script checks that the connection is to a list of authorized networks and then proceeds to launch transmission-daemon.

Create a start script in folder /etc/wicd/scripts/postconnect , and a stop script in folder /etc/wicd/scripts/predisconnect . Remember to make them executable. For example:

Choosing a user

Choose how you want to run transmission :

  • As a separate user, transmission by default (recommended for increased security).

By default, transmission creates a user and a group transmission , with its home files at /var/lib/transmission/ , and runs as this «user». This is a security precaution, so transmission, and its downloads, have no access to files outside of /var/lib/transmission/ . Configuration, operation, and access to downloads needs to be done with «root» privileges (e.g. by using sudo).

To set this up, override the provided service file and specify your username:

Configuring the daemon

Create an initial configuration file by starting the daemon.

  • If running Transmission under the username transmission , the configuration file will be located at /var/lib/transmission/.config/transmission-daemon/settings.json .
  • If running Transmission under your own username, the configuration file will be located at

    One can customize the daemon by using a Transmission client or using the included web interface accessible via http://localhost:9091 in a supported browser.

    A guide to configuration options can be found on the Transmission web site: https://github.com/transmission/transmission/wiki/Editing-Configuration-Files

    A recommendation for those running under username transmission is to create a shared download directory with the correct permissions to allow access to both the transmission user and system users, and then to update the configuration file accordingly. For example:

    Now /mnt/data/torrents will be accessible for the system user facade and for the transmission group to which the transmission user belongs. Making the target directory world read/writable is highly discouraged (i.e. do not chmod the directory to 777). Instead, give individual users/groups appropriate permissions to the appropriate directories.

    An alternative is to add your user to the transmission group ( #usermod -a -G transmission yourusername ) and then modify the permissions on the /var/lib/transmission and /var/lib/transmission/Downloads directories to allow rwx access by members of the transmission group.

    Host whitelist

    If you plan to access the Transmission daemon over the network using the server’s hostname, you need to add this hostname to rpc-host-whitelist in settings.json . Otherwise, you will get a «421 Misdirected Request» error when accessing the server.

    If you connect to the daemon using the server’s IP-address, this is not required.

    Watch dir

    If you want to Automatically add .torrent files from a folder, but you find that the watch-dir and watch-dir-enabled options set in the config file do not work, you can start the transmission daemon with the flag -c /path/to/watch/dir .

    If you are using systemd, edit the transmission.service unit as described in systemd#Editing provided units.

    Enable IPv6

    By default, the daemon only listens for IPv4 connections. To also listen for IPv6 connections, change the rpc-bind-address option to «::» in settings.json .

    CLI Examples

    If you want to remove all finished torrents you can use the following command with your own username and password:

    Seed a torrent which has already been downloaded:

    Web Interface

    The GUI way

    Once Transmission is installed, you can easily set up the web interface. All you need to do is click the edit menu and select preferences. Click the Remote tab and enable Allow remote access.

    Here, you have the opportunity to change the default listening port from 9091.

    Check the Use authentication and fill in a username and password so that authentication can be used.

    To increase security, you can restrict access from any IP address by enabling Only allow these IP addresses.

    Now you are ready to launch the web interface by either clicking on the Open web client, which makes your default web browser open it, or manually reaching http://TARGET_IP_ADDRESS:PORT with any supported web browser.

    If you have not changed the listening port, the default one is 9091. In this case, the link is http://localhost:9091

    The CLI way

    You do not need a graphical interface to set up the web interface, the daemon offers the very same options. You can reach the web interface without specifing any flags. See #Starting and stopping the daemon

    Nevertheless, you can specify everything that you see in the previous section:

    is equivalent to

    Optional web UI theme

    If the default user interface of the web app seems outdated and less fancy than expected, try using https://git.eigenlab.org/sbiego/transmission-web-soft-theme for a simple CSS theme.

    https://github.com/ronggang/transmission-web-control also provides a full replacement that can coexist with the default UI.

    Troubleshooting

    Cannot access the daemon over the network

    The daemon is started after network.service was initialised. However, if you enable the service dhcpcd as opposed to the device-specific service, such as dhcpcd@enp1s0.service for example, it may happen that Transmission is started too early and cannot bind to the network interface. Thus, the web interface is unreachable. A possible solution is to add the Requires line to the unit’s configuration file:

    Web interface cannot be reached

    Even if you use the graphical interface, you still need to install transmission-cli in order for web interface to work.

    Failed to set send/receive buffer

    Transmission might display either of these messages in the journal on startup:

    Источник

    Читайте также:  Меню для ярлыков windows
Оцените статью