Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a way to provide some option to SCP to show host name or IP address while prompting for pasword

For eg:

In my machine the pwd prompt is always displayed as "Password"

$ scp sources/update_git.sh root@xx.213.xx.xx:/sds

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Password:

But I need something like below

$ scp sources/update_git.sh root@xx.213.xx.xx:/sds

root@xx.213.xx.xx’s password:

>Solution :

Make sure password authentication is enabled on the server. In /etc/ssh/sshd_config:
PasswordAuthentication yes

On the client side, set password as the preferred method
ssh -o PreferredAuthentications=password server2

It is sensible to add the keyboard-interactive method to the list in case the server has PasswordAuthentication disabled

ssh -o PreferredAuthentications=password,keyboard-interactive server2

I ended up adding the following to my .ssh/config:

Host *
ServerAliveInterval 120
VerifyHostKeyDNS yes
PreferredAuthentications publickey,password,keyboard-interactive

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading