Ethernet Switching
Highlighted
Ethernet Switching

ssh with root password

‎10-02-2019 06:24 PM

Hi all,

1-) How to use root password with when doing ssh to another EX from a EX... Like this format root@EX> ssh wasEx4200 password zzzzzz

 

2-) Is there a way to automatically passing (yes/no) promt and then directly get >cli promt rather than getting % shell fist?

 

Hia all,

root@ex4200> ssh wasEx4200
The authenticity of host 'wasEx4200(x.x.x.x)' can't be established.
ECDSA key fingerprint is ae:fd:83:04:ee:d31:83:n6:81:w3:3d:d7:07:dd:26:5f.
Are you sure you want to continue connecting (yes/no)? yes---------------------------->
Warning: Permanently added 'wasEx4200,x.x.x.x' (ECDSA) to the list of known hosts.
-----------------------------------
UNAUTHORISED ACCESS PROHIBITTED
-----------------------------------
root@wasEx4200's password:
--- JUNOS 12.3R12.4 built 2016-01-20 04:27:03 UTC
root@ex4200> :RE:0% cli
root@ex4200>
2 REPLIES 2
Highlighted
Ethernet Switching

Re: ssh with root password

‎10-02-2019 11:23 PM

The (yes/no)? prompt will be for first time since hosts file does not have user added,

 

Getting the shell prompt is expect ,

 

My suggestion would be to use a login script  to automate which can get to cli 

 

Thank you

Prabin

Highlighted
Ethernet Switching

Re: ssh with root password

‎10-03-2019 02:27 AM

Hi, 

 

1) Password cannot be passed natively in ssh. Normally on linux you could use sshpass. However other option is to use ssh-keys instead of password authentication.

2) To bypass the hostkey authenticity prompt, you can specify:

ssh -o "StrictHostKeyChecking=no" user@host

or add these lines in .ssh/config from the shell.

Host <host>
    Hostname <host>
	StrictHostKeyChecking no

Host *                                  # For all hosts
   StrictHostKeyChecking no
   UserKnownHostsFile=/dev/null

>>then directly get >cli promt rather than getting % shell fist?

User root by default drops into the shell. To get into the cli, you could use another user with same privileges as root.

 

Hope this helps.

 

Cheers, 

Ashvin