how to execute ssh command in line [closed]

i know how can ssh to server as

$ ssh <user>@<domain>

then second the command prompt ask for password as

<user>@<domain>'s password : -----

here how can be able to do same with one line ?, that looks like

$ssh <user>@<domain-name> -p <pass>

is it possible ? if yes how ?

Answer

There are several ways to help you doing this. But you may have a security concern in mind while using those tools.

  1. ssh-key without passphrase (lack of security here)

You can create a ssh-key and add it to the trusted keys on your distant server.

  1. ssh-key with ssh-agent

You can create a ssh-key with a passphrase (more secure) and use ssh-agent to help with automation.

  1. ssh config file

This file may help to pair keys with servers

Attribution
Source : Link , Question Author : Greesh Kumar , Answer Author : Django Janny

Leave a Comment