Make sure you have the correct public key set (generate a new RSA key pair just to be sure, and copy the public key to the switch), also you can try junos credentials from your script rather than ssh keys to verify other parts.
Also, just to verify the SSH keys, I would avoid the pyez script at first, just ssh the switch directly from your CLI and see if the SSH keys work or not.
------------------------------
Ramon Martinez Garcia
------------------------------
Original Message:
Sent: 10-24-2022 02:29
From: NICO BOCCIA
Subject: ssh connection permission denied
thanks for ur reply. its a windows computer where iam doin coding. and there i have all permissions (admin rights)
i tryed a lot but nothing work. very crazy
------------------------------
NICO BOCCIA
Original Message:
Sent: 10-21-2022 03:07
From: Ramon Martinez Garcia
Subject: ssh connection permission denied
check the folder permissions as well.
ls -ld
if your owner permission doesn't have read, write and execute permissions change them:
chmod 0700 /home/your_home/.ssh
------------------------------
Ramon Martinez Garcia
Original Message:
Sent: 10-20-2022 05:49
From: NICO BOCCIA
Subject: ssh connection permission denied
Hi all,
i start with pyez and hang directly at the login to the device. i took the example from the documentation and want to connect via ssh to the device. by default pyez uses the /.ssh/ folder.
but i always get a "PermissionError: [Errno 13] Permission denied: './ssh".
i have also run it as admin or copied it locally somewhere else.
any idea?
regards
nico
import sysfrom getpass import getpassfrom jnpr.junos import Devicefrom jnpr.junos.exception import ConnectErrorhostname = 'xxx' # input("Device hostname: ")# junos_username = input("Junos OS username: ")# junos_password = getpass("Junos OS or SSH key password: ")ssh_config_file = "./sshconf/"dev = Device(host=hostname, ssh_config=ssh_config_file)try: with Device(host=hostname, user=junos_username, passwd=junos_password) as dev: print (dev.facts)except ConnectError as err: print ("Cannot connect to device: {0}".format(err)) sys.exit(1)except Exception as err: print (err) sys.exit(1)
------------------------------
NICO BOCCIA
------------------------------