![]() |
Re: Script to open SSH connection and run commands on other Linux device
Wow!
Thank you very much for your help - I'll try it tomorrow! |
Re: Script to open SSH connection and run commands on other Linux device
Note that you don't need to be ROOT to do this. Creating an authorized key is something that you do on an account-by-account basis.
This is how I do it for my linux systems: Code:
[Log in as myself, on my local machine] The above works fine, as long as there actually is an .ssh directory in the remote location account. That'll be the case if you sometime in the past used an ssh command on that remote account. (Note that '-l user host' is equivalent with 'user@host' as far as ssh is concerned.) If the 'date' command works then you should be able to put ssh commands into a local script. Make sure that commands you pass to the remote computer are available there on that remote computer. NB: There is no reason to involve the root account in this. |
Re: Script to open SSH connection and run commands on other Linux device
Yesterday i had time to try it.
After a few problems (file-permissions) it worked well :) Now I can switch the lights in my living room from all over the world with my N900 ;) (I know - "who needs?" - but it's very funny :D) Thanks to all! |
Re: Script to open SSH connection and run commands on other Linux device
Quote:
|
Re: Script to open SSH connection and run commands on other Linux device
Code:
[Desktop Entry] in "/usr/share/applications/hildon/" I haven't had time to program a script yet so it just doe one ssh tunnel the icons below are placed in "/usr/share/icons/hicolor/scalable/hildon/" http://www.jdidesign.com/files-in/rdp.png http://www.jdidesign.com/files-in/ssh.png |
Re: Script to open SSH connection and run commands on other Linux device
i want to turn on / off wifi (router)
i cant get this working with the .desktop file Code:
[Desktop Entry] open gainrooted xterm and type Code:
ssh root@xxx.xxx.xxx.xxx wl radio off whats wrong? anybody have nice icons for wifi on / off ? :D |
Re: Script to open SSH connection and run commands on other Linux device
I am no Linux guru but i run an ssh command on my router by executing the flowing command from withing the xxx.desktop file
Code:
Exec=/usr/bin/osso-xterm 'ssh -l root myip.com -p 22 /usr/sbin/wol -i 192.100.1.255 00:X3:18:F1:86:A1' myip.com = router address. the ssh command i would run from xterminal this is the path to the command on my router so if i had to guess this is what your command should look like: Code:
Exec=/usr/bin/osso-xterm 'ssh root@xxx.xxx.xxx.xxx wl radio off' Code:
Exec=/usr/bin/osso-xterm 'ssh router.ip.com -p 22 root@xxx.xxx.xxx.xxx wl radio off' Code:
Exec=/usr/bin/osso-xterm 'ssh -l root router.ip.com -p 22 root@xxx.xxx.xxx.xxx wl radio off' |
Re: Script to open SSH connection and run commands on other Linux device
btw: ssh-copy-id is available on the N900 for copying your public key to a remote machine easily
shortens the whole setup to: Code:
ssh-keygen |
Re: Script to open SSH connection and run commands on other Linux device
thanks ;)
i found a solution myself ( thanks to subcore) i had to make the ssh-keygen command with normal "user" xterm and not "root". this is the solution because its harder to start xterm with root rights and ssh and the wl radio off command. now everything works well ;) now i only need some nice wlan on / off icons :D but i cant find icons :-( |
Re: Script to open SSH connection and run commands on other Linux device
here are 2 icons i made from the first google wlan image that popped up.
http://www.jdidesign.com/files-in/maemo/wlan-off.png http://www.jdidesign.com/files-in/maemo/wlan-on.png |
All times are GMT. The time now is 10:03. |
vBulletin® Version 3.8.8