[new] ssh scripts(connect_server,config_ssh)
[dotfiles_afify.git] / .scripts / config_ssh.sh
bloba3628b4a85b56d89c81993195649a3375cefb886
1 #!/usr/bin/env bash
3 #sshd
4 sudo sh -c "echo \"
5 KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
6 PasswordAuthentication no
7 ChallengeResponseAuthentication no
8 PubkeyAuthentication yes
9 AllowGroups ssh-user
10 Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
11 MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com\" >> /etc/ssh/sshd_config; groupadd ssh-user; usermod -a -G ssh-user $USER"
13 #ssh
14 echo -e "\nHost *
15 KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
16 PasswordAuthentication no
17 ChallengeResponseAuthentication no
18 PubkeyAuthentication yes
19 HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa
20 Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
21 MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
22 UseRoaming no" >> ~/.ssh/config