GNS3 Docker Images
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. FROM debian:stretch-slim
  2. COPY tac_passwd /usr/local/sbin/
  3. RUN set -e -x \
  4. #
  5. # install tacacs+ server
  6. #
  7. && export DEBIAN_FRONTEND=noninteractive \
  8. && apt-get update \
  9. && apt-get -y --no-install-recommends install \
  10. dumb-init tacacs+ \
  11. net-tools iproute2 ifupdown isc-dhcp-client inetutils-ping \
  12. telnet traceroute procps nano vim-tiny \
  13. && rm -rf /var/lib/apt/lists/* \
  14. #
  15. # tac_plus.conf template for do_auth
  16. #
  17. && printf '\
  18. \043 My simple tacplus config that never needs to change\n\
  19. \043 See https://github.com/jathanism/do_auth\n\
  20. key = mykey\n\
  21. \n\
  22. accounting file = /var/log/tacplus.acct\n\
  23. \n\
  24. default authentication = file /etc/tacacs+/passwd\n\
  25. \n\
  26. user = DEFAULT {\n\
  27. member = doauthaccess\n\
  28. }\n\
  29. \n\
  30. group = doauthaccess {\n\
  31. default service = permit\n\
  32. \n\
  33. service = exec {\n\
  34. priv-lvl = 15\n\
  35. idletime = 10\n\
  36. }\n\
  37. \n\
  38. enable = file /etc/tacacs+/passwd\n\
  39. after authorization "do_auth -i '\''$address'\'' -u '\''$user'\'' -d '\''$name'\'' -l /var/log/do_auth.log -f /etc/tacacs+/do_auth.ini"\n\
  40. }\n' \
  41. > /etc/tacacs+/tac_plus.conf.do_auth \
  42. #
  43. # tacacs utilities
  44. #
  45. && chmod 755 /usr/local/sbin/tac_passwd \
  46. && ln -s tac_passwd /usr/local/sbin/tac_adduser \
  47. && ln -s tac_passwd /usr/local/sbin/tac_deluser \
  48. && printf '\
  49. \043!/bin/sh\n\
  50. \n\
  51. tac_plus -C /etc/tacacs+/tac_plus.conf -P\n' \
  52. > /usr/local/sbin/tac_parse && chmod +x /usr/local/sbin/tac_parse \
  53. && printf '\
  54. \043!/bin/sh\n\
  55. \n\
  56. service tacacs_plus reload\n' \
  57. > /usr/local/sbin/tac_reload && chmod +x /usr/local/sbin/tac_reload \
  58. && printf '\
  59. \043!/bin/sh\n\
  60. \n\
  61. service tacacs_plus start\n' \
  62. > /usr/local/sbin/tac_start && chmod +x /usr/local/sbin/tac_start \
  63. && printf '\
  64. \043!/bin/sh\n\
  65. \n\
  66. service tacacs_plus stop\n' \
  67. > /usr/local/sbin/tac_stop && chmod +x /usr/local/sbin/tac_stop \
  68. && chown -h root:root /usr/local/sbin/* \
  69. #
  70. # startup script
  71. #
  72. && printf '\
  73. \043!/bin/sh\n\
  74. [ $$ -eq 1 ] && exec dumb-init -- "$0" "$@"\n\
  75. \n\
  76. service tacacs_plus start\n\
  77. \n\
  78. cd /etc/tacacs+\n\
  79. exec bash -i\n' \
  80. > /etc/init.sh && chmod +x /etc/init.sh
  81. VOLUME [ "/etc/tacacs+" ]
  82. CMD [ "/etc/init.sh" ]