tail log via ssh with password not working
rafaelbiriba opened this issue · 2 comments
After:
ssh user@server.com tail /opt/log/access.log | ngxtop
The ssh prompt the password...
After that nothing happens.
Hi Rafael!
I always login to remote servers with my private key, as it is more convenient than passwords.
If you have a public/private keys pair you can type this to put your public key into the remote server:
cat ~/.ssh/id_dsa.pub | ssh user@server.com 'cat - >> ~/.ssh/authorized_keys2'
If not, follow the instructions in http://mah.everybody.org/docs/ssh (previous code is from that page) to generate the pair and then put the public one into the server.
When you try to connect to a remote server, ssh asks for a password or a passphrase to unlock your private key, depending on the server configuration and the information it has about you (basically, your public key).
A tool called ssh agent can keep in the memory of your local terminal the information needed to access the private key, so you don't need to type your password or passphrase each time.
To start the ssh agent, type
ssh-add
Then, you'll be asked for the passphrase. After that, you should access to the remote server with no more prompts.
I hope this help you
Even I am facing this issue. I have to su - production_user
to another user, for accessing the log files. production_user
doesn't have direct ssh access. I don't know how to proceed with this.