chmod +x *.sh
This commit is contained in:
parent
e0f90ab6b4
commit
be8adebf89
6
exec-add-rsapub-to-remote.sh
Normal file → Executable file
6
exec-add-rsapub-to-remote.sh
Normal file → Executable file
@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
if [ $1 ]
|
if [ $1 ]
|
||||||
then
|
then
|
||||||
REMOTEHOST=$1
|
REMOTEHOST=$1
|
||||||
@ -5,6 +7,8 @@ else
|
|||||||
read -p "Enter user@remotehost " REMOTEHOST
|
read -p "Enter user@remotehost " REMOTEHOST
|
||||||
fi
|
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"
|
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
0
exec-change-hook-path.sh
Normal file → Executable file
0
exec-git-pull-all.sh
Normal file → Executable file
0
exec-git-pull-all.sh
Normal file → Executable file
0
exec-rsync2remote.sh
Normal file → Executable file
0
exec-rsync2remote.sh
Normal file → Executable file
20
setup-debian.sh
Normal file → Executable file
20
setup-debian.sh
Normal file → Executable file
@ -3,9 +3,9 @@ echo "Example: setup.sh alice"
|
|||||||
|
|
||||||
if [ v$1 != v ]
|
if [ v$1 != v ]
|
||||||
then
|
then
|
||||||
export User=$1
|
NewUser=$1
|
||||||
else
|
else
|
||||||
export User=adot
|
NewUser=adot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
apt update
|
apt update
|
||||||
@ -39,17 +39,17 @@ echo "<<< Change root password"
|
|||||||
passwd
|
passwd
|
||||||
|
|
||||||
echo "<<< Add a new user"
|
echo "<<< Add a new user"
|
||||||
useradd $User
|
useradd $NewUser
|
||||||
# usermod -a -G sudo $User # Add to sudo group
|
# usermod -a -G sudo $NewUser # Add to sudo group
|
||||||
passwd $User
|
passwd $NewUser
|
||||||
mkdir /home/$User
|
mkdir /home/$NewUser
|
||||||
chown $User:$User /home/$User
|
chown $NewUser:$NewUser /home/$NewUser
|
||||||
chmod 700 /home/$User
|
chmod 700 /home/$NewUser
|
||||||
# emacs /etc/passwd
|
# emacs /etc/passwd
|
||||||
# Debian 10 default to /bin/sh
|
# 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
|
# 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"
|
echo "<<< Allow sudo without password: %sudo ALL=(ALL:ALL) NOPASSWD:ALL"
|
||||||
chmod o+w /etc/sudoers
|
chmod o+w /etc/sudoers
|
||||||
|
0
setup-home.sh
Normal file → Executable file
0
setup-home.sh
Normal file → Executable file
0
setup-homebrew.sh
Normal file → Executable file
0
setup-homebrew.sh
Normal file → Executable file
0
setup-mongodb.sh
Normal file → Executable file
0
setup-mongodb.sh
Normal file → Executable file
0
setup-node-by-nvm.sh
Normal file → Executable file
0
setup-node-by-nvm.sh
Normal file → Executable file
0
setup-node.sh
Normal file → Executable file
0
setup-node.sh
Normal file → Executable file
0
setup-ssr.sh
Normal file → Executable file
0
setup-ssr.sh
Normal file → Executable file
Loading…
Reference in New Issue
Block a user