From 50585ee995c908c151db01fce151833361a83aab Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sat, 5 Oct 2019 13:40:01 +0800 Subject: [PATCH] =?UTF-8?q?[setup-debian.sh]=20=E7=94=A8=20sed=20=E4=BB=A3?= =?UTF-8?q?=E6=9B=BF=20emacs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bashrc | 1 + setup-debian.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index ee14fb5..5e03a26 100644 --- a/.bashrc +++ b/.bashrc @@ -43,6 +43,7 @@ alias ssh='ssh -C -X' alias cvs='cvs -z9' alias ps='ps -elf' +alias emacs='emacs -nw' # Set default file permission mask: umask 022 # rwxr-xr-x diff --git a/setup-debian.sh b/setup-debian.sh index d9c34f0..bd47385 100644 --- a/setup-debian.sh +++ b/setup-debian.sh @@ -20,15 +20,18 @@ useradd $User passwd $User mkdir /home/$User chown $User:$User /home/$User -emacs /etc/passwd +# emacs /etc/passwd +sed -i "s/\/home\/$User:/\/home\/$User:\/bin\/bash/g" /etc/passwd echo ">>> allow sudo without password: %sudo ALL=(ALL:ALL) NOPASSWD:ALL" chmod o+w /etc/sudoers -emacs /etc/sudoers +# emacs /etc/sudoers +sed -i "s/%sudo\s+ALL*/%sudo ALL=(ALL:ALL) NOPASSWD:ALL/g" /etc/sudoers chmod o-w /etc/sudoers echo ">>> disallow root login: #PermitRootLogin yes" -emacs /etc/ssh/sshd_config +sed -i "s/^PermitRootLogin yes/#PermitRootLogin yes/g" /etc/ssh/sshd_config +# emacs /etc/ssh/sshd_config service sshd restart echo ">>> configure locales: install all-locales, default to zh-CN.UTF-8"