Adrián Bíro

SSH and remoting tips

RDP

man freerdp

freerdp /u:<Name> /p:<Password> /d:<ad.domain.com> /v:<ip_addr> /w:1920 /h:1080 /fonts /smart-sizing
function ,freerdp(){
  freerdp /w:1920 /h:1080 /fonts /smart-sizing "${@}"
}

SFTP

sftp <user>@<host>
lls; lcd; lpwd
put local2remote.log  
get remote2local.log
quit

SSH

Jump host

ssh -A -J <user>@<host2> <host1>

Forward Agent problems

Host <host1>
    User <user>
    HostName <fullhostname>
    ProxyJump <user>@<host2>
    ForwardAgent yes

remote2clipboard.sh on server

mkfifo ~/clip
grep 'ERROR' file.log > ~/clip

on client

#!/bin/sh
ssh <hostname> 'cat clip' | xclip -selection clipboard #clip on win

Ignore pre-authentication banner message from server:

ssh -o LogLevel=error <user@host>

Limits the used bandwidth for csp, specified in Kbit/s.

scp -l 8500 server:/file .

Tunel db via socket to localhost

ssh -N -L 1234:/var/run/mysqld/mysqld.sock user@dbhost

Use different ssh keys with git

GIT_SSH_COMMAND="ssh -i ~/.ssh/id_custom" git clone ...

Commands in public keys

Infecting SSH Public Keys with backdoors sshd(8) AUTHORIZED_KEYS_FILE_FORMAT

no-port-forwarding,no-agent-forwarding,command="echo 'Please login as the user \"ubuntu\" rather than the user \"root\".';echo;sleep 10;exit 142" ssh-ed25519 AAAA...

Remote Access Policy

Hardening OpenSSH server Mozilla

Hardening OpenSSH client Digitalocean

Sshaudit online

SSH hardening guides

Sshaudit Github

2FA with ssh

2FA with ssh on OpenBSD