0

Is it possible to redirect password prompt alert to a file or silence it?

[lnx51 ~]$ ssh root@192.168.1.1 root@192.168.1.1's password:

foo_l
  • 591
  • 2
  • 10
  • 28
  • Do you want that doesnt ask password and plan to use a id_rsa or something like that? or are you asking to automate put the password? – Joan Esteban Nov 17 '16 at 08:24

2 Answers2

1

Use batchmode to prevent ssh from prompting for passwords etc esp if you are running via rsync. (I am assuming you will set up passphrase based authentication)

ssh -o BatchMode=yes root@hostname command
codegrep_admin
  • 519
  • 4
  • 7
  • I still see the prompt. Does dropbear ssh doesn't support the batchmode option? `lnx~#rsync -v -r -l -e ssh -o BatchMode =yes -i /root/ssh/id_rsa -y -y samp.txt root@10.1.13.1:/home/ root@10.1.13.1's password:` – foo_l Nov 17 '16 at 07:04
1

To avoid password authentication you can use next sentence:

  ssh -o PasswordAuthentication=no root@192.168.1.1

This disable 'manual' authentication but you need another method to login, if not you will get an error like that:

  Permission denied (publickey,password).

Maybe you have some issue with your id_rsa

If you want to use with rsync (as your example) you must put command with quotes ("):

   rsync -v -r -l -e "ssh -o PasswordAuthentication=no"  ctxt root@192.168.6.2:/home/

You can check rsync options at here

Joan Esteban
  • 1,006
  • 12
  • 23
  • With direct ssh it works but with rsync it fails. Anything I'm missing?thanks. `[lnx5 ~]$ rsync -v -r -l -e ssh -o PasswordAuthentication=no ctxt root@192.168.6.2:/home/ root@192.168.6.2's password:` – foo_l Nov 17 '16 at 09:35