You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, April 4th 2006, 2:50pm

panel button / sudo / sshfs

Hi,

I'd appreciate any help with an irritating problem. I'm using Fedora 3 with KDE 3.3.

I frequently need to access a large number of externel servers from my dekstop. Most of these are locked down accept for ssh so I mount the drives through fuse using sshfs. I've written a short shell script to mount the drives for me:

>>>
mntsers.sh
>>>
mount -t cifs //serve/uname /mnt/serve -o user=uname,domain=domain,rw
sshfs uname@serve1:/uname /mnt/serve1 -o allow_other
sshfs uname@serve2:/uname /mnt/serve2 -o allow_other
sshfs uname@serve3:/uname /mnt/serve3 -o allow_other
xhost + serve1

>>>

I need to mount as root so I use sudo, here is mu /etc/sudoers

>>>>
/etc/sudoers
>>>>
uname ALL=NOPASSWD: /bin/sh
>>>>

Now if I do

$ sudo sh mntsers.sh

the drives mount and everything is nice...

I want to be able to mount and unmount quickly so I try and put a button on my KDE panel. I choose Add->Special Button->Non KDE Application and put

sudo

as the "executable"

and

sh mntsers.sh

as the "optional command line arguments". If check "Run in terminal". If I click the button the script appears to run - i get promped for server passwords etc. and the cifs drive is mounted. However: My Problem: the sshfs mounts refuse to mount. I get the same problem if I put a KDE link on the desktop. Bizarely the mounting works okay if I add a final line to my mntsers.sh script so it looks like this:

>>>
mntsers.sh
>>>
mount -t cifs //serve/uname /mnt/serve -o user=uname,domain=domain,rw
sshfs uname@serve1:/uname /mnt/serve1 -o allow_other
sshfs uname@serve2:/uname /mnt/serve2 -o allow_other
sshfs uname@serve3:/uname /mnt/serve3 -o allow_other
xhost + serve1
read dummy

>>>

I cant find an explanation. Any help appreciated - I'd really like to get rid of that final line and save myself a carriage return!

Cheers

Will

bram85

Professional

Posts: 948

Location: Eindhoven

Occupation: Software Engineer

  • Send private message

2

Wednesday, April 5th 2006, 6:34pm

RE: panel button / sudo / sshfs

Try creating a shortcut (like you already did) with the following command:

Source code

1
konsole --noclose -e /path/to/mntsers.sh
Bram Schoenmakers
KDE Netherlands (www.kde.nl)