article:post-installation_rapide_distribution_debian
Post-installation "Titux" distribution Debian
sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y sudo dpkg-reconfigure locales sudo dpkg-reconfigure tzdata sudo apt install git unzip make tree bridge-utils net-tools whois pv rsync byobu rlwrap curl zsh fonts-powerline fail2ban rkhunter dialog htop bash -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" export ZSH="$HOME/.oh-my-zsh" # autosuggesions plugin git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH/plugins/zsh-autosuggestions # zsh-syntax-highlighting plugin git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH/plugins/zsh-syntax-highlighting # zsh-history-substring-search plugin git clone https://github.com/zsh-users/zsh-history-substring-search $ZSH/custom/plugins/zsh-history-substring-search # zsh-autocomplete plugin git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH/plugins/zsh-autocomplete ## en tantque root curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh sh setup-repos.sh apt-get install webmin --install-recommends apt-get install --install-recommends ./webmin-current.deb cat >/etc/sysctl.conf <<EOF net.ipv4.ip_forward=1 net.ipv4.conf.all.proxy_arp=1 EOF ################################################################################################### cat >.shell.tux<<EOF #!/usr/bin/bash ##---------------------------------------------------------------------------------- alias zshconfig="nano -cl ~/.zshrc" ##---------------------------------------------------------------------------------- ## fontions utiles ############################################################### # function g() { grep $@ | grep -v grep } # function lancer_agent_ssh() { memo_ssh="/run/user/$(id -u)/env_ssh" [ -e $memo_ssh ] && { eval $(cat $memo_ssh) >/dev/null } || { mkdir -p /run/user/$(id -u) ssh-agent >$memo_ssh eval $(cat $memo_ssh) >/dev/null ssh-add } } memo_ssh="/run/user/$(id -u)/env_ssh" [ -e $memo_ssh ] && lancer_agent_ssh ##---------------------------------------------------------------------------------- ##---------------------------------------------------------------------------------- [ -e $HOME/bin ] && export PATH=$HOME/bin:/usr/local/bin:$PATH # ##---------------------------------------------------------------------------------- ## alias ########################################################################### # alias ls="/bin/ls --color --group-directories-first -p" alias ll="ls -l --color" alias la="ls -lah" alias l="ls -1" alias rm="/bin/rm -i" alias cp="/bin/cp -i" alias mv="/bin/mv -i" alias f="clear" ##---------------------------------------------------------------------------------- ##---------------------------------------------------------------------------------- # ################################################################################################### EOF cat >.zshrc<<EOF ##---------------------------------------------------------------------------------- echo $PATH|grep $HOME/bin: >/dev/null; [ $? -ne 0 ] && [ -e $HOME/bin ] && export PATH=$HOME/bin:$PATH # ##---------------------------------------------------------------------------------- ## Constantes environnement ############################################################### # export LANG=fr_FR.UTF-8 export LANGUAGE=fr_FR export ARCHFLAGS="-arch x86_64" # ##---------------------------------------------------------------------------------- ## oh-my-zsh ########################################################################### # export ZSH="$HOME/.oh-my-zsh/" zstyle ':omz:update' mode auto # update automatically without asking plugins=(git colored-man-pages zsh-navigation-tools zsh-autosuggestions) export EDITOR=nano #source /usr/share/powerline/bindings/zsh/powerline.zsh export ZSH_THEME="agnoster" export LANG=fr_FR.UTF-8 export LANGUAGE=fr_FR source $ZSH/oh-my-zsh.sh export PROMPT="%{%f%b%k%} $(build_prompt) > " alias zshconfig="nano -cl ~/.zshrc" ##---------------------------------------------------------------------------------- source ~/.shell.tux ##---------------------------------------------------------------------------------- ################################################################################################### EOF [ -e /etc/ssh/sshd_config.origine ] || cat /etc/ssh/sshd_config>/etc/ssh/sshd_config.origine cat >/etc/ssh/sshd_config_titux.org <<EOF ################################################################################################### ChallengeResponseAuthentication no UsePAM no X11Forwarding yes PrintMotd yes AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server IgnoreRhosts yes IgnoreUserKnownHosts no StrictModes yes PubkeyAuthentication yes RSAAuthentication yes PermitRootLogin without-password PermitEmptyPasswords no PasswordAuthentication no GatewayPorts no AllowTcpForwarding yes KeepAlive yes Protocol 2 EOF cat /etc/ssh/sshd_config_titux.org >/etc/ssh/sshd_config systemctl restart sshd rsync -va /home/$(grep 1000 /etc/passwd|cut -d: -f1)/.ssh /root/ chown -R root:root /root/.ssh
article/post-installation_rapide_distribution_debian.txt · Dernière modification : 2024/12/04 18:55 de estro