Cannot sshpass router


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cannot sshpass router
# 1  
Old 08-02-2014
Cannot sshpass router

Hi,

I am trying to use sshpass to login to my router and then execute a reboot command. But the command never executes, can someone please help me.
This doesnt work....
Code:
sshpass -p 'password' ssh 192.168.1.1 -l root -o StrictHostKeyChecking=no "sys reboot"

However if I try following then it works and shows result
Code:
 sshpass -p 'password' ssh 192.168.1.100 -l root -o StrictHostKeyChecking=no "uptime;uname -a"

then I see the system up time result.

Any ideas? Smilie

Thanks in advance.

Last edited by jeetz; 08-02-2014 at 01:08 PM..
# 2  
Old 08-02-2014
Are you sure it does not execute? Could be it drops the line as it's booting...?
# 3  
Old 08-02-2014
Quote:
Originally Posted by RudiC
Are you sure it does not execute? Could be it drops the line as it's booting...?
no it doesnt execute, because I tried show adsl instead of sys reboot. no joy Smilie
# 4  
Old 08-02-2014
So show adsl works? Seems to me reboot works, then. Have the router run for a while, show its uptime, reboot, show uptime again - any difference?
# 5  
Old 08-02-2014
Code:
show adsl

also doesnt work.

your suggestion in the other post has solved my problem, but dont know why I am feeling that the telnet session seems flakey there (can let me down anytime), therefore am looking to execute this ssh session and do a sys reboot command
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Put a command into router through sshpass bash script

hello, i am facing some issue. I am using a simple bash script that via sshpass put a command into router. Now, problem is that i have a file and commands into it. sshpass -p $pass ssh -o $log -n $user@$h /ip address set address=10.0.0.1/24 so if I have that command ip address set ... (0 Replies)
Discussion started by: tomislav91
0 Replies

2. Shell Programming and Scripting

problem with sshpass

Hello i am using sshpass to pass remote password into script but phase some problems when try to execute some commands remotely which means that the remote env not passed through sshpass for example sshpass -p 'XXX' ssh -o StrictHostKeyChecking=no -l myserver myserver visu_fis_pnes ... (2 Replies)
Discussion started by: mogabr
2 Replies

3. UNIX for Dummies Questions & Answers

Remote Unix printing to my WinXP works with no router. How can I make it work through my router?

I set up remote printing on a clients Unix server to my Windows XP USB printer. My USB printer is connected directly to my PC (no print server and no network input on printer). With my Win XP PC connected to my cable modem (without the router), i can do lp -dhp842c /etc/hosts and it prints. I... (7 Replies)
Discussion started by: jmhohne
7 Replies
Login or Register to Ask a Question