~.
The ssh log is no longer at /var/log/secure.
Use:
journalctl -u sshd
Tail with:
journalctl -fu sshd
systemctl status sshd.service
systemctl restart sshd.service
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
sed "/^#Port 22/i Port 5083" /etc/ssh/sshd_config | sudo tee /etc/ssh/sshd_config
systemctl restart sshd.service
Verify that the key is found in ssh agent:
ssh-add -L
Verify that forward agent works:
local> ssh <my-host>
my-host> ssh -T <another-host>
ssh-keygen -lf ~/.ssh/rsa_key.pub
To kick an ssh session:
who -u
:: Get the pid
kill <pid>
View ssh sessions with start and end times:
last -F
To see keys in ssh-agent:
ssh-add -L
To remove all keys in ssh-agent:
ssh-add -D
To add key to ssh-agent:
ssh-add -k <private-key>
To use ssh to launch a remote script that uses sudo, pass the
-t
flag:
ssh -l user host -t 'sudo ls'
ssh -vv <your-host>