SSH

ssh -o KexAlgorithms=+diffie-hellman-group1-sha1
ssh -o TCPKeepAlive=yes -o ServerAliveCountMax=600 -o ServerAliveInterval=30
ssh -o HostkeyAlgorithms=+ssh-rsa
scp -o "ProxyCommand=nc -x 127.0.0.1:1086 %h %p" -P $port /Volumes/Data/1.txt user@www.server.com:~
scp -o "ProxyCommand=d:\nmap\ncat.exe --proxy 127.0.0.1:1086 %h %p" -P $port /Volumes/Data/1.txt user@www.server.com:~
$keyFile = "E:\Codes\id_rsa"

icacls $keyFile /inheritance:r
icacls $keyFile /remove "NT AUTHORITY\Authenticated Users"
icacls $keyFile /remove "BUILTIN\Users"
icacls $keyFile /remove "Everyone"
icacls $keyFile /grant:r "${env:USERNAME}:(R)"
function Set-SshPrivateKeyPermission {
    param (
        [Parameter(Mandatory=$true)]
        [string]$KeyFile
    )

    icacls $KeyFile /inheritance:r
    icacls $KeyFile /remove "NT AUTHORITY\Authenticated Users"
    icacls $KeyFile /remove "BUILTIN\Users"
    icacls $KeyFile /remove "Everyone"
    icacls $KeyFile /grant:r "${env:USERNAME}:(R)"
}

Set-SshPrivateKeyPermission "E:\Codes\id_rsa"
powered by GitbookFile Modify: 2026-08-31 11:04:08

results matching ""

    No results matching ""