Hi,
I'm writing a backup program which SSH's into the Device, pulls of the config, and then stores this where we want it to, the TFTP Backup isnt practical for us.
This works fine if I do it for a Cisco, Juniper, Mikrotik Etc.
However when I run a quick test using the below command it does show the data, but seems to error in a loop:
sshpass -p 'password' ssh -p 22 -o StrictHostKeyChecking=no admin@'ip' < netonix-commands.txt
The netonix-commands.txt file looks like this:
cmdline
cat config.json
exit
tcsetattr ICANON: Invalid argument
tcsetattr ~ICANON: Invalid argument
tcsetattr(): Invalid argument
tcsetattr ICANON: Invalid argument
tcsetattr ~ICANON: Invalid argument
tcsetattr(): Invalid argument
tcsetattr ICANON: Invalid argument
tcsetattr ~ICANON: Invalid argument
tcsetattr(): Invalid argument
tcsetattr ICANON: Invalid argument
tcsetattr ~ICANON: Invalid argument
Thanks
Mike
tcsetattr ~ICANON: Invalid argument
-
MichaelBrandl - Member
- Posts: 29
- Joined: Mon Sep 21, 2015 11:15 am
- Location: Hampshire, UK
- Has thanked: 4 times
- Been thanked: 2 times
-
sirhc - Employee
- Posts: 7416
- Joined: Tue Apr 08, 2014 3:48 pm
- Location: Lancaster, PA
- Has thanked: 1608 times
- Been thanked: 1325 times
Re: tcsetattr ~ICANON: Invalid argument
Curious what the TFTP backup lacks that you need?
Support is handled on the Forums not in Emails and PMs.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.
-
MichaelBrandl - Member
- Posts: 29
- Joined: Mon Sep 21, 2015 11:15 am
- Location: Hampshire, UK
- Has thanked: 4 times
- Been thanked: 2 times
Re: tcsetattr ~ICANON: Invalid argument
I'd really like security, centralised management of what I can back up, and the way I'm doing it I can have a separate file showing what changes were made.
-
jakematic - Experienced Member
- Posts: 168
- Joined: Thu Jul 14, 2016 8:15 am
- Location: NC USA
- Has thanked: 362 times
- Been thanked: 87 times
Re: tcsetattr ~ICANON: Invalid argument
I use scp to pull the configs, but you need to setup a key pair and put it in /etc/dropbear/authorized_keys
- Code: Select all
scp admin@ws12:/www/config.json config.json
-
sirhc - Employee
- Posts: 7416
- Joined: Tue Apr 08, 2014 3:48 pm
- Location: Lancaster, PA
- Has thanked: 1608 times
- Been thanked: 1325 times
Re: tcsetattr ~ICANON: Invalid argument
MichaelBrandl wrote:I'd really like security, centralised management of what I can back up, and the way I'm doing it I can have a separate file showing what changes were made.
Then setup a log server and it records the save and what was changed
Support is handled on the Forums not in Emails and PMs.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.
-
mike99 - Associate
- Posts: 837
- Joined: Tue Nov 25, 2014 10:53 am
- Location: Quebec, Canada
- Has thanked: 95 times
- Been thanked: 245 times
Re: tcsetattr ~ICANON: Invalid argument
MichaelBrandl wrote:sshpass -p 'password' ssh -p 22 -o StrictHostKeyChecking=no admin@'ip' < netonix-commands.txt
...
I'd really like security
sshpass is not considered secure since you keep in clear text the password of a device in your script. A simple error and everybody can access it. Kind of error I saw, stocking the scripts under the www folder. You switch should not change much so the method describe by jakematic is the secure way to do automatic remote ssh connection.
-
MichaelBrandl - Member
- Posts: 29
- Joined: Mon Sep 21, 2015 11:15 am
- Location: Hampshire, UK
- Has thanked: 4 times
- Been thanked: 2 times
Re: tcsetattr ~ICANON: Invalid argument
It's all in PHP, and the files are ssl encrypted so the password isn't in plain text. However if someone could get onto the server they may be a problem.
Thanks for the advice and I'll try using a keypair and SCP.
Thanks
Mike
Thanks for the advice and I'll try using a keypair and SCP.
Thanks
Mike
7 posts
Page 1 of 1
Who is online
Users browsing this forum: No registered users and 44 guests