How to automatically enter user password when prompted by terminal

user273652

If I am working in a terminal that is currently SSH logged in to a remote server user@node, and I want to transfer a file from local to that same server, I will run:

scp you@your_local_machine:/home/you/"FileName.csv" user@node:"~/folder"

It'll then ask for my local machine's login password. This is fine, but is there a way that I can modify the above scp call to automatically enter my password to the terminal instead of needing to type it in manually?

Ashildr

SSH (Secure Shell) can be set up with public/private key pairs so that you don't have to type the password each time. On the local machine,type

ssh-keygen -t dsa 

To get the key on the server, you have two choices:

  • Use ssh-copy-id (standard with most Linuxes), e.g. ssh-copy-id user@server
  • Paste the content of the local ~/.ssh/id_dsa.pub file into the file ~/.ssh/authorized_keys on the remote host.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to automatically enter username and password when prompted to connect to a remote server

How to change language automatically when prompted for a password?

Automatically do keypress enter when prompted in command prompt

How to provide input to cmd automatically when prompted?

Amazon EC2 - Prompted for Password when Switching to Passwordless User

How to Prompt the user to press Enter to Exit in terminal so that the terminal doesn't close automatically?

How to print the timestamp on the terminal when user press Enter

How to make python script press 'enter' when prompted on Shell

how to declare that you have full superuser permissions when prompted on terminal?

how to show enter password in the form of Asterisks(*) on terminal

How to enter user credentials when calling password protected URL from a worklight adapter?

How to use system build-in passcode screen to authenticate my App when user clicks Enter Password

How do i add <br> automatically in textarea when a user press "enter" key?

How can place a job of linux terminal to background after enter password?

How to generate password automatically when a user registers in laravel 8.x?

When I enter wrong userid or password, It just say **Please enter user id and password**

how to load byobu automatically when terminal started?

User in admin group still being prompted for password to sudo

How can I handle a user clicking cancel when prompted to open another app

Pytest with argparse: how to test user is prompted for confirmation?

Auto-enter a value when prompted from a Python Script

Proper way to let user enter password for a bash script using only the GUI (with the terminal hidden)

how to create a website that prompts the user to enter his login id and password

Prompted for key password when key is in ssh-agent

How to automatically login as a user using Spring Security without knowing their password?

How to automatically add user account AND password with a Bash script?

How to show the user their automatically generated password after social login?

I can't see the password when I enter it in Terminal wth the command "su"

MySQL prompted twice for password