ssh
ssh key
[!TIP|label:resolve ssh permission issue:]
get servers public key
upload the local ~/.ssh/know_hosts
[!NOTE|label:references:]
add ssh key into agent
get public key from private key
generate new passphrase
get fingerprinter
sha256:
md5:
with openssl
keys performance
ssh
force use password
allows ssh-rsa
[!TIP|label:references:]
for git commands
[!NOTE|label:references:]
since git v2.33.1
force bypass ~/.ssh/config
~/.ssh/config[!NOTE|label:references:]
$ man ssh
[!TIP|label:references:]
tar all and extra in remote
copy local file content into remote
[!NOTE|label:references:]
with proxy
using command directly
Linux:
windows:
git for windows
cygwin
ssh certificate
[!NOTE|label:references:]
14.3.3. Creating SSH CA Certificate Signing Keys
Files Associated with SSH Host Certificates
Certificate Authority (ca) - a private key generated for signing other keys
Certificate public key - the public component of the certificate authority
Host Public Key - the actual key that the SSH daemon uses to identify itself to the clients
Host Certificate - the signature made for the Host Public Key using the Certificate Authority
ca
sign and generate cert key
verify
update for existing key
login via specific cert
[!NOTE|label:references:]
ssh tunnel
[!TIP|label:references:]
key point:
-L:<--
-R:-->basic command line
usage:
1 -> [2 ->] 3:ssh host2:port2:host3:port3 host1:port1if ignore
host2. default using local.hostreferences:
two servers
-L
-L[!TIP]
purpose:
-R
-R[!TIP]
status:
three serves
scenario 1
scenario 2
[!TIP]
details :
config
ssh config
sshd_config
[!TIP]
disable Root Login :
PermitRootLoginallow only specific users or groups :
AllowUsers,AllowGroupsdeny specific users or groups :
DenyUsers,DenyGroupschange sshd port number :
Portchange login grace time :
LoginGraceTimeRestrict the Interface (IP Address) to Login :
ListenAddressdisconnect ssh when no activity :
ClientAliveInterval
banner and motd
[!TIP] files:
/etc/pam.d/sshd:session optional pam_motd.so:/usr/lib64/security/pam_motd.so
/etc/motd
/etc/ssh/sshd_config:Banner /path/to/banner
disable login password
scripts:
disallow group to use password
[!TIP|label:references:]
Directive 'UsePAM' is not allowed within a Match block
Directive 'ChallengeResponseAuthentication' is not allowed within a Match block
Directive 'PrintMotd' is not allowed within a Match block
Directive 'LoginGraceTime' is not allowed within a Match block
disallowing user to use tcp forwarding
displaying a special banner for users not in the staff group
allowing root login from host rootallowed.example.com
allowing anyone to use gatewayports from the local net
debug
debug git
GIT_SSH_COMMAND
debug ssh
debug mode
test mode
check sshd log
[!NOTE|label:references:]
tips
[!NOTE|label:references:]
disconnect
[!TIP] Enter + ~ + . + Enter
references:
execute shell commands via ssh
[!NOTE|label:references:]
ctrl-c to break while loop
execute local script via ssh
[!NOTE|label:references:]

Last updated
Was this helpful?