diff options
author | Daniil Baturin <daniil@baturin.org> | 2018-06-24 12:50:17 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2018-06-24 12:50:17 +0200 |
commit | bacecf80ea16d3cd30dc7c98c98af013b2adc258 (patch) | |
tree | 2b1d6f48708ace28ae4f6c9893ee50f6f390c6b7 /scripts/system/vyatta_update_telnet | |
parent | 0d8e75e2e808ccf366a1527647a6353c09d92237 (diff) | |
parent | 0f19dc57ed6588c083eee8aa9aee09b92b441b08 (diff) | |
download | vyatta-cfg-system-lithium.tar.gz vyatta-cfg-system-lithium.zip |
Merge branch 'current' into lithiumlithium
Conflicts:
debian/changelog
scripts/snmp/vyatta-snmp-v3.pl
scripts/snmp/vyatta-snmp.pl
templates/interfaces/tunnel/node.def
templates/system/sysctl/custom/node.def
Diffstat (limited to 'scripts/system/vyatta_update_telnet')
-rwxr-xr-x | scripts/system/vyatta_update_telnet | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/scripts/system/vyatta_update_telnet b/scripts/system/vyatta_update_telnet deleted file mode 100755 index f50eef79..00000000 --- a/scripts/system/vyatta_update_telnet +++ /dev/null @@ -1,84 +0,0 @@ -#! /bin/bash -# Script to control telnet daemon parameters -# and block changes when logged in over telnet - -# Block changes to telnet daemon when logged in over telnet -pid=$(who -um | awk -F " " '{print $7}') -if [ -n "$pid" ]; then - if ps --pid $(ps --pid $pid -o ppid=) -o cmd= | grep -q telnetd - then - echo "Please configure telnet settings via ssh or console." - exit 1 - fi -fi - -usage() { - echo "Usage: $0 enable <port>" - echo " $0 disable" - echo " $0 allow-root {true|false}" - exit 1; -} - -allow-root() { - case "$1" in - true) ;; - false) ;; - *) echo "Expect true or false" - usage ;; - esac - - sudo sed -i -e '/^# Pseudo-terminal (telnet)/,$d' /etc/securetty - - if [ $1 = "false" ]; then - return - fi - - sudo sh -c "cat >>/etc/securetty" <<EOF -# Pseudo-terminal (telnet) -pts/0 -pts/1 -pts/2 -pts/3 -pts/4 -pts/5 -pts/6 -pts/7 -pts/8 -pts/9 -pts/10 -pts/11 -pts/12 -pts/13 -pts/14 -pts/15 -pts/16 -pts/17 -pts/18 -pts/19 -EOF - -} - -case "$1" in - allow-root) - allow-root $2 - ;; - - enable) - if [ -z "$2" ] - then echo "Missing port number"; - usage - fi - exec sudo /opt/vyatta/sbin/telnetd.init restart $2 $3 - ;; - - disable) - exec sudo /opt/vyatta/sbin/telnetd.init stop - ;; - - *) - echo "Unknown argument $1"; - usage - ;; -esac - |