Reply
Thread Tools
Posts: 92 | Thanked: 9 times | Joined on Nov 2009 @ Germany, Bavaria
#11
Wow!

Thank you very much for your help - I'll try it tomorrow!
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#12
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]
ssh-keygen -r rsa -N ''
[press return for default options]
cat .ssh/id_rsa.pub | ssh -l remote_account remote_computer "cat >> .ssh/authorized_keys"
[answer password question]
ssh -l remote_account remote_computer date
The last command should provide 'date' output without asking for password. If it still does, then check directory permissions of remote home directory and remote $HOME/.ssh directory. No group or world writeability, please. Check again, fix, until you don't have to enter the password anymore.

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.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.

Last edited by TA-t3; 2010-01-07 at 11:42.
 

The Following User Says Thank You to TA-t3 For This Useful Post:
Posts: 92 | Thanked: 9 times | Joined on Nov 2009 @ Germany, Bavaria
#13
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 )

Thanks to all!

Last edited by RouterRebooter; 2010-01-08 at 14:16.
 
Posts: 35 | Thanked: 2 times | Joined on Dec 2009 @ sweden
#14
Originally Posted by timwatt View Post
Hi RouterRebooter,
The info to make a desktop icon to run an ssh command can be found in this post:
http://talk.maemo.org/showthread.php?t=35858

I used it to run WOL (an installed app on my Linux device) via SSH. the icon method allows you to run one command. but you can make a script to run many commands. the cool thing is you can also make your own icons too. i am a newbie to Linux and the terminal but with minimal experienced i achieved success. a program i found essential was WinSCP it gives you a windows GUI like file manager to you n900 after you have installed SSH Server.

I had to install a new program on my n900 and restart before my icons showed up. I now have several custom desktop icons that run SSH scripts.

good luck
tim

ps. if you read the whole post i ask all the newbie questions.
How does your code look like, i have placed a shortcut on the desktop but nothing happens when i click it?
 
Posts: 352 | Thanked: 231 times | Joined on Jul 2008 @ Vancouver
#15
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Name=SSH 
Terminal=true
Type=Application
Exec=/usr/bin/osso-xterm 'ssh -l root -L 3389:192.168.5.555:3389 me.tzo.com -p 22'
Icon=ssh
X-Osso-Type=application/x-executable
code above in ssh.desktop file
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/"


 

The Following User Says Thank You to timwatt For This Useful Post:
Posts: 70 | Thanked: 6 times | Joined on Oct 2009
#16
i want to turn on / off wifi (router)

i cant get this working with the .desktop file

Code:
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=WirelessOff 
Exec=/bin/busybox sh -c 'ssh root@xxx.xxx.xxx.xxx wl radio off' 
Icon=ssh
Type=Application
this didnt work.

open gainrooted xterm and type
Code:
ssh root@xxx.xxx.xxx.xxx wl radio off
works well.

whats wrong?



anybody have nice icons for wifi on / off ?

Last edited by no mercy; 2010-01-22 at 11:53.
 
Posts: 352 | Thanked: 231 times | Joined on Jul 2008 @ Vancouver
#17
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'
I think that means use xTerminal
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'
and to do it over the web:
Code:
Exec=/usr/bin/osso-xterm 'ssh router.ip.com -p 22 root@xxx.xxx.xxx.xxx wl radio off'
or

Code:
Exec=/usr/bin/osso-xterm 'ssh -l root router.ip.com -p 22 root@xxx.xxx.xxx.xxx wl radio off'
but then again i have no Linux experience so more than that I cant help.
 
Shanezlar's Avatar
Posts: 38 | Thanked: 67 times | Joined on Oct 2009 @ Allemagne
#18
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
ssh-copy-id user@host
You can then login passwordlessly with "ssh user@host"
 
Posts: 70 | Thanked: 6 times | Joined on Oct 2009
#19
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 but i cant find icons :-(

Last edited by no mercy; 2010-01-22 at 19:17.
 

The Following User Says Thank You to no mercy For This Useful Post:
Posts: 352 | Thanked: 231 times | Joined on Jul 2008 @ Vancouver
#20
here are 2 icons i made from the first google wlan image that popped up.


 

The Following User Says Thank You to timwatt For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 14:51.