PHP Deployment Scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
neatoDeploy/deploy_files/deploy_ssh_client.php

37 lines
1.1 KiB

<?php
forceNormal();
$host = "Host *
Protocol 2
HostKeyAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group18-sha512,diffie-hellman-group16-sha512
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256
StrictHostKeyChecking ask
VerifyHostKeyDNS ask
User root
Port 22
ServerAliveInterval 300
ServerAliveCountMax 3
ForwardAgent no
ForwardX11 no
ForwardX11Trusted no
PermitLocalCommand no
HashKnownHosts yes
TCPKeepAlive yes
SendEnv LANG LC_*";
$home = ($_SERVER['HOME']) ?? false;
if ($home === false) {
echo "Unknown home path!";
exit(1);
}
if (! file_exists("$home/.ssh/config")) {
appendToFile("$home/.ssh/config", $host);
chmodFileOrDir("$home/.ssh/config", "config");
} else {
echo "$home/.ssh/config exists! \r\n";
echo $host;
}