2

**strong text* cat /etc/init.d/tftpd-hpa

!/bin/sh

BEGIN INIT INFO

Provides: tftpd-hpa

Required-Start: $local_fs $remote_fs $syslog $network

Required-Stop: $local_fs $remote_fs $syslog $network

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

Short-Description: HPA's tftp server

Description: Trivial File Transfer Protocol (TFTP) is a file transfer

protocol, mainly to serve boot images over the network

to other machines (PXE).

END INIT INFO

PATH="/sbin:/bin:/usr/sbin:/usr/bin" DAEMON="/usr/sbin/in.tftpd"

test -x "$DAEMON" || exit 0

NAME="in.tftpd" DESC="HPA's tftpd" PIDFILE="/var/run/tftpd-hpa.pid" DEFAULTS="/etc/default/tftpd-hpa"

set -e

[ -r "$DEFAULTS" ] && . "$DEFAULTS"

. /lib/lsb/init-functions

do_start() { # Ensure --secure and multiple server directories are not used at the # same time if [ "$(echo $TFTP_DIRECTORY | wc -w)" -ge 2 ] && \ echo $TFTP_OPTIONS | grep -qs secure then echo echo "When --secure is specified, exactly one directory can be specified." echo "Please correct your $DEFAULTS." exit 1 fi

# Ensure server directories exist
for d in $TFTP_DIRECTORY
do
    if [ ! -d "$d" ]
    then
        echo "$d missing, aborting."
        exit 1
    fi
done

start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- \
    --listen --user $TFTP_USERNAME --address $TFTP_ADDRESS \
    $TFTP_OPTIONS $TFTP_DIRECTORY

}

do_stop () { start-stop-daemon --stop --quiet --oknodo --name $NAME }

do_reload () { start-stop-daemon --stop --quiet --oknodo --name $NAME --signal 1 }

case "$1" in start) init_is_upstart > /dev/null 2>&1 && exit 1

    log_daemon_msg "Starting $DESC" "$NAME"
    do_start
    log_end_msg $?
    ;;

stop)
    init_is_upstart > /dev/null 2>&1 && exit 0

    log_daemon_msg "Stopping $DESC" "$NAME"
    do_stop
    log_end_msg $?
    ;;

restart|force-reload)
    init_is_upstart > /dev/null 2>&1 && exit 1

    log_daemon_msg "Restarting $DESC" "$NAME"
    do_stop
    sleep 1
    do_start
    log_end_msg $?
    ;;

status)
    status_of_proc $DAEMON $NAME
    ;;

*)
    echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
    exit 3
    ;;

esac


$ sudo systemctl status tftpd-hpa ● tftpd-hpa.service - LSB: HPA's tftp server Loaded: loaded (/etc/init.d/tftpd-hpa; bad; vendor preset: enabled) Active: active (exited) since Thu 2017-05-04 13:17:46 IST; 2s ago Docs: man:systemd-sysv-generator(8) Process: 6838 ExecStart=/etc/init.d/tftpd-hpa start (code=exited, status=0/SUC

May 04 13:17:46 virendra systemd[1]: Starting LSB: HPA's tftp server... May 04 13:17:46 virendra systemd[1]: Started LSB: HPA's tftp server. lines 1-8/8 (END)

1
  • 1
    And what's the question ?
    – Soren A
    May 4, 2017 at 8:30

1 Answer 1

0

Try this

 sudo apt install tftpd-hpa

create directory /tftp

 sudo mkdir /tftp
 sudo chmod 777 /tftp

then edit /etc/default/tftpd-hpa to like above

vi /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure -c"

Then restart service

sudo service tftpd-hpa restart

Allow access in UFW

sudo ufw allow 69

After that you can go to cisco and copy config to tftp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.