How to check sshd log?

If no one else is using the system at the moment you could do what i’ve done in such cases: stop sshd service (at least i’ve been able to do this while logged in via ssh) start sshd manually and add some -d options to get more verbose debug output. Unless you have something funky … Read more

ssh-agent forwarding and sudo to another user

As you mentioned, the environment variables are removed by sudo, for security reasons. But fortunately sudo is quite configurable: you can tell it precisely which environment variables you want to keep thanks to the env_keep configuration option in /etc/sudoers. For agent forwarding, you need to keep the SSH_AUTH_SOCK environment variable. To do so, simply edit … Read more

SSH use only my password, Ignore my ssh key, don’t prompt me for a passphrase

Try ssh -o PasswordAuthentication=yes -o PreferredAuthentications=keyboard-interactive,password -o PubkeyAuthentication=no host.example.org In ssh v2, keyboard-interactive is another way to say “password”. The -o PubkeyAuthentication=no option instructs the client not to attempt key pair authentication. In addition, the PasswordAuthentication=yes option is to override any previously configured ssh options that may have disabled it.

How to reconnect to a disconnected ssh session

UPDATE: For an actual answer see zero_r’s answer below This isn’t an answer, but a workaround. Use screen. When you first log in, run screen. You get another shell, run commands in that. If you’re disconnected, the screen process keeps the terminal alive so that your shell and the processes it is running don’t fall … Read more

“Add correct host key in known_hosts” / multiple ssh host keys per hostname?

get the rsa key of your server, where server_ip is your server’s IP address, such as 192.168.2.1: $ ssh-keyscan -t rsa server_ip Sample response: # server_ip SSH-2.0-OpenSSH_4.3 server_ip ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwH5EXZG… and on the client, copy the entire response line server_ip ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwH5EXZG…, and add this key to the bottom of your ~/.ssh/known_hosts file: server_ip ssh-rsa … Read more

How do diff over ssh?

You can do it with Bash’s process substitution: diff foo <(ssh myServer ‘cat foo’) Or, if both are on remote servers: diff <(ssh myServer1 ‘cat foo’) <(ssh myServer2 ‘cat foo’)

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)