chmod +x *.sh

This commit is contained in:
陆柯 2019-12-14 12:02:51 +08:00
parent e0f90ab6b4
commit be8adebf89
11 changed files with 15 additions and 11 deletions

6
exec-add-rsapub-to-remote.sh Normal file → Executable file
View File

@ -1,3 +1,5 @@
#!/bin/bash
if [ $1 ]
then
REMOTEHOST=$1
@ -5,6 +7,8 @@ else
read -p "Enter user@remotehost " REMOTEHOST
fi
scp ~/.ssh/id_rsa.pub $REMOTEHOST:~/tmp.pub
scp ~/.ssh/id_rsa.pub $REMOTEHOST:~/tmp.pub
ssh $REMOTEHOST "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat ~/tmp.pub >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys && rm -f ~/tmp.pub"
echo ~/.ssh/id_rsa.pub is appended to $REMOTEHOST:~/.ssh/authorized_keys

0
exec-change-hook-path.sh Normal file → Executable file
View File

0
exec-git-pull-all.sh Normal file → Executable file
View File

0
exec-rsync2remote.sh Normal file → Executable file
View File

20
setup-debian.sh Normal file → Executable file
View File

@ -3,9 +3,9 @@ echo "Example: setup.sh alice"
if [ v$1 != v ]
then
export User=$1
NewUser=$1
else
export User=adot
NewUser=adot
fi
apt update
@ -39,17 +39,17 @@ echo "<<< Change root password"
passwd
echo "<<< Add a new user"
useradd $User
# usermod -a -G sudo $User # Add to sudo group
passwd $User
mkdir /home/$User
chown $User:$User /home/$User
chmod 700 /home/$User
useradd $NewUser
# usermod -a -G sudo $NewUser # Add to sudo group
passwd $NewUser
mkdir /home/$NewUser
chown $NewUser:$NewUser /home/$NewUser
chmod 700 /home/$NewUser
# emacs /etc/passwd
# Debian 10 default to /bin/sh
sed -i "s/\/home\/$User:\/bin\/sh$/\/home\/$User:\/bin\/bash/g" /etc/passwd
sed -i "s/\/home\/$NewUser:\/bin\/sh$/\/home\/$NewUser:\/bin\/bash/g" /etc/passwd
# Debian 9 default to empty
sed -i "s/\/home\/$User:$/\/home\/$User:\/bin\/bash/g" /etc/passwd
sed -i "s/\/home\/$NewUser:$/\/home\/$NewUser:\/bin\/bash/g" /etc/passwd
echo "<<< Allow sudo without password: %sudo ALL=(ALL:ALL) NOPASSWD:ALL"
chmod o+w /etc/sudoers

0
setup-home.sh Normal file → Executable file
View File

0
setup-homebrew.sh Normal file → Executable file
View File

0
setup-mongodb.sh Normal file → Executable file
View File

0
setup-node-by-nvm.sh Normal file → Executable file
View File

0
setup-node.sh Normal file → Executable file
View File

0
setup-ssr.sh Normal file → Executable file
View File