From 61a4f83cb749761704905c333195f75d70195ad9 Mon Sep 17 00:00:00 2001 From: DuckDuckWhale Date: Sat, 22 Oct 2022 00:19:35 -0700 Subject: [PATCH] Add: automatic configuration script --- auto/auto.sh | 24 +++++++++++++++++++ {bash => auto/bash}/.bashrc.append | 2 +- auto/bash/bash.sh | 2 ++ {git => auto/git}/git.sh | 0 auto/gnome/gnome.sh | 3 +++ .../home-chmod/home-chmod.sh | 0 {readline => auto/readline}/.inputrc | 0 auto/readline/readline.sh | 2 ++ auto/ssh/authorized_keys | 2 ++ auto/ssh/config | 3 +++ auto/ssh/ssh.sh | 5 ++++ {tmux => auto/tmux}/.tmux.conf | 0 auto/tmux/tmux.sh | 2 ++ {vim => auto/vim}/.vimrc | 0 vim/vim-plug.sh => auto/vim/vim.sh | 1 + {mac => system/mac-fnmode}/fnmode-once.sh | 0 .../mac-fnmode}/fnmode-persistent.sh | 0 system/sshd/sshd_config | 15 ++++++++++++ .../udev}/lock-screen-on-hid-connection.sh | 0 19 files changed, 60 insertions(+), 1 deletion(-) create mode 100755 auto/auto.sh rename {bash => auto/bash}/.bashrc.append (98%) create mode 100755 auto/bash/bash.sh rename {git => auto/git}/git.sh (100%) create mode 100755 auto/gnome/gnome.sh rename permissions.sh => auto/home-chmod/home-chmod.sh (100%) rename {readline => auto/readline}/.inputrc (100%) create mode 100755 auto/readline/readline.sh create mode 100644 auto/ssh/authorized_keys create mode 100644 auto/ssh/config create mode 100755 auto/ssh/ssh.sh rename {tmux => auto/tmux}/.tmux.conf (100%) create mode 100755 auto/tmux/tmux.sh rename {vim => auto/vim}/.vimrc (100%) rename vim/vim-plug.sh => auto/vim/vim.sh (89%) rename {mac => system/mac-fnmode}/fnmode-once.sh (100%) rename {mac => system/mac-fnmode}/fnmode-persistent.sh (100%) create mode 100644 system/sshd/sshd_config rename {udev => system/udev}/lock-screen-on-hid-connection.sh (100%) diff --git a/auto/auto.sh b/auto/auto.sh new file mode 100755 index 0000000..b836a70 --- /dev/null +++ b/auto/auto.sh @@ -0,0 +1,24 @@ +#!/bin/sh +cd bash +./bash.sh +cd .. + +cd git +./git.sh +cd .. + +cd ssh +./ssh.sh +cd .. + +cd vim +./vim.sh +cd .. + +cd gnome +./gnome.sh +cd .. + +cd home-chmod +./home-chmod.sh +cd .. diff --git a/bash/.bashrc.append b/auto/bash/.bashrc.append similarity index 98% rename from bash/.bashrc.append rename to auto/bash/.bashrc.append index 6dd8adb..3f4bd5b 100644 --- a/bash/.bashrc.append +++ b/auto/bash/.bashrc.append @@ -1,5 +1,5 @@ -# customized +# custom umask 007 diff --git a/auto/bash/bash.sh b/auto/bash/bash.sh new file mode 100755 index 0000000..0b2eac6 --- /dev/null +++ b/auto/bash/bash.sh @@ -0,0 +1,2 @@ +#!/bin/sh +cat .bashrc.append >> ~/.bashrc diff --git a/git/git.sh b/auto/git/git.sh similarity index 100% rename from git/git.sh rename to auto/git/git.sh diff --git a/auto/gnome/gnome.sh b/auto/gnome/gnome.sh new file mode 100755 index 0000000..0a113fe --- /dev/null +++ b/auto/gnome/gnome.sh @@ -0,0 +1,3 @@ +#!/bin/sh +gsettings set org.gnome.desktop.wm.keybindings switch-group "['Above_Tab']" +gsettings set org.gnome.desktop.wm.keybindings switch-group-backward "['Above_Tab']" diff --git a/permissions.sh b/auto/home-chmod/home-chmod.sh similarity index 100% rename from permissions.sh rename to auto/home-chmod/home-chmod.sh diff --git a/readline/.inputrc b/auto/readline/.inputrc similarity index 100% rename from readline/.inputrc rename to auto/readline/.inputrc diff --git a/auto/readline/readline.sh b/auto/readline/readline.sh new file mode 100755 index 0000000..f13382d --- /dev/null +++ b/auto/readline/readline.sh @@ -0,0 +1,2 @@ +#!/bin/sh +cp -i .inputrc ~ diff --git a/auto/ssh/authorized_keys b/auto/ssh/authorized_keys new file mode 100644 index 0000000..b5792ff --- /dev/null +++ b/auto/ssh/authorized_keys @@ -0,0 +1,2 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPclu8pJC3f2MGIx/8cS/ssl7KnJB/tfmUpFRdtM7TAU DuckDuckWhale +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ+TiOFdNZVEgF0dU82CJfa9KlVNMJsgnPX0RItfNnIZ DuckDUckWhale Phone diff --git a/auto/ssh/config b/auto/ssh/config new file mode 100644 index 0000000..98a1863 --- /dev/null +++ b/auto/ssh/config @@ -0,0 +1,3 @@ +Host * + ForwardX11Trusted no + IdentitiesOnly yes diff --git a/auto/ssh/ssh.sh b/auto/ssh/ssh.sh new file mode 100755 index 0000000..9344839 --- /dev/null +++ b/auto/ssh/ssh.sh @@ -0,0 +1,5 @@ +#!/bin/sh +mkdir -p ~/.ssh +chmod 700 ~/.ssh +cp -i authorized_keys config ~/.ssh/ +chmod 600 ~/.ssh/authorized_keys ~/.ssh/config diff --git a/tmux/.tmux.conf b/auto/tmux/.tmux.conf similarity index 100% rename from tmux/.tmux.conf rename to auto/tmux/.tmux.conf diff --git a/auto/tmux/tmux.sh b/auto/tmux/tmux.sh new file mode 100755 index 0000000..409fbc0 --- /dev/null +++ b/auto/tmux/tmux.sh @@ -0,0 +1,2 @@ +#!/bin/sh +cp -i .tmux.conf ~ diff --git a/vim/.vimrc b/auto/vim/.vimrc similarity index 100% rename from vim/.vimrc rename to auto/vim/.vimrc diff --git a/vim/vim-plug.sh b/auto/vim/vim.sh similarity index 89% rename from vim/vim-plug.sh rename to auto/vim/vim.sh index 9a81469..37b33ae 100755 --- a/vim/vim-plug.sh +++ b/auto/vim/vim.sh @@ -1,3 +1,4 @@ #!/bin/sh +cp -i .vimrc ~ curl -Lo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim diff --git a/mac/fnmode-once.sh b/system/mac-fnmode/fnmode-once.sh similarity index 100% rename from mac/fnmode-once.sh rename to system/mac-fnmode/fnmode-once.sh diff --git a/mac/fnmode-persistent.sh b/system/mac-fnmode/fnmode-persistent.sh similarity index 100% rename from mac/fnmode-persistent.sh rename to system/mac-fnmode/fnmode-persistent.sh diff --git a/system/sshd/sshd_config b/system/sshd/sshd_config new file mode 100644 index 0000000..2017770 --- /dev/null +++ b/system/sshd/sshd_config @@ -0,0 +1,15 @@ +Include /etc/ssh/sshd_config.d/*.conf +AllowGroups ssh-users +Port 22 +PermitRootLogin no +PubkeyAuthentication yes +PasswordAuthentication no +# would be deprecated soon by +# KbdInteractiveAuthentication no +ChallengeResponseAuthentication no +UsePAM yes +AllowTcpForwarding yes +X11Forwarding yes +PrintMotd no +AcceptEnv LANG LC_* +Subsystem sftp /usr/lib/openssh/sftp-server diff --git a/udev/lock-screen-on-hid-connection.sh b/system/udev/lock-screen-on-hid-connection.sh similarity index 100% rename from udev/lock-screen-on-hid-connection.sh rename to system/udev/lock-screen-on-hid-connection.sh