I am trying to create a launcher for the left bar on ubuntu 11.10, I followed this answer, and it works, but I want to auto login into the SSH servers, so I tried using a command I have used before, something like:
expect -c 'spawn ssh root@111.222.333.444 ; expect assword ; send "password123\n" ; expect root@; send "unset HISTFILE\n" ; interact'
That works fine when typed on a console directly, but when I put it on my shortcut Exec= section, then I click the launcher icon and nothing happens, there's no terminal with ssh opened or anything else.
This is how the shortcut file loos like:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Name=Remote Servers
Comment=Login to my servers
Exec=notify-send "Select a server" "You have to select a server to SSH into" -i /usr/share/icons/gnome/256x256/status/messagebox_warning.png -t 5000
Terminal=false
X-MultipleArgs=false
Type=Application
Icon[en_US]=/home/username/.icons/ssh.png
StartupNotify=true
StartupWMClass=RemoteServers
X-Ayatana-Desktop-Shortcuts=Server1;Server2;
[Server1 Shortcut Group]
Name=SSH into 111.222.333.444
Exec=expect -c 'spawn ssh root@111.222.333.444 ; expect assword ; send "password123\n" ; expect root@; send "unset HISTFILE\n" ; interact'
TargetEnvironment=Unity
[Server2 Shortcut Group]
Name=SSH into 111.222.333.444
Exec=expect -c 'spawn ssh root@111.222.333.444 ; expect assword ; send "password123\n" ; expect root@; send "unset HISTFILE\n" ; interact'
TargetEnvironment=Unity
I though this would work because I've created another shortcut to launch a virtual machine, I created it using gnome-desktop-item-edit --create-new
, and the command in "Exec=" is just the same as when typed on the console.
Anyone knows how could I get this working?