From b95f643a43c62662e4ab316fac09644a1acebd85 Mon Sep 17 00:00:00 2001 From: klea Date: Sun, 7 Jun 2026 17:06:43 +0000 Subject: Restrict on login --- addkey | 2 +- catkeys | 2 +- delkey | 2 +- help | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addkey b/addkey index 6926249..1ede417 100755 --- a/addkey +++ b/addkey @@ -5,4 +5,4 @@ tr -dc 'a-zA-Z0-9 +/=:\n-' | sed 's/^/restrict,pty /' - >>"$HOME/.ssh/authorized_keys" echo "New keys:" -cat -n "$HOME/.ssh/authorized_keys" +"$HOME"/git-shell-commands/catkeys diff --git a/catkeys b/catkeys index 79dbc3d..1ab8d2d 100755 --- a/catkeys +++ b/catkeys @@ -1,4 +1,4 @@ #!/bin/bash # cat your authorized_keys -cat -n "$HOME/.ssh/authorized_keys" +cat -n "$HOME/.ssh/authorized_keys" | sed 's/restrict,pty //' diff --git a/delkey b/delkey index fcb858c..a49c7b8 100755 --- a/delkey +++ b/delkey @@ -16,4 +16,4 @@ fi sed -i "$line_no"d "$HOME/.ssh/authorized_keys" echo "New keys:" -cat -n "$HOME/.ssh/authorized_keys" +"$HOME"/git-shell-commands/catkeys diff --git a/help b/help index 1b74237..bcbd21a 100755 --- a/help +++ b/help @@ -1,6 +1,7 @@ #!/bin/sh # Send help. I'm trapped in the machine. +sed -i '/restrict,pty /!s/^/restrict,pty /' "$HOME/.ssh/authorized_keys" echo -e "\e]0;$USER@$HOSTNAME\e\\" if [ $# -eq 0 ]; then -- cgit v1.3.1-10-gc9f91