Results 1 to 7 of 7

Thread: .sh script, Autostart.sh help

  1. #1
    Join Date
    Mar 2009
    Location
    Cork, Ireland
    Beans
    239
    Distro
    Ubuntu Development Release

    .sh script, Autostart.sh help

    Ok, so the Prefix says Ubuntu, but what I'm asking about is actually in #! Crunchbang 9.04, but I figure that seeing as the underlying OS is the same, I'll ask for help here.

    So, my problem is that I have 3 sshfs shares which I would like to mount automatically at login. I presume that this means editing the autostart.sh script, but using a lot of trial and error, I found out that you cant do it by the seat of your pants.

    The shares mount to ~/Server, ~/Two-Face and ~/Data using the command
    Code:
    sshfs davee@ip_address:/path/to/directory /mount/point
    Now, I've made three .sh scripts for each mount (and corresponding umount .sh scripts), and when excuted, these ask for the server's user password. Ideally, I'd like these to mount automatically on login, and not to ask for a password.

    Like I said, this is in #!, so if anyone here knows anything I'm missing, please fill me in

    Note: I've already tried and failed in using ob-autostart.


    Thanks in advance to anyone able to help
    Acer Aspire T650, 3GHz PIV 1.4Gb RAM ATi Radeon Xpress 200
    320+80GB SATA Ubuntu 9.10 Karmic x86_64 Windows XP Home SP3

    Linux Expresso - Now featuring videos of my systems!

  2. #2
    Join Date
    May 2007
    Beans
    980
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: .sh script, Autostart.sh help

    I mount a samba shared drive by just adding the proper line to /etc/fstab
    I've never worked with sshfs before, but probably you can do something similar to this:
    Code:
    //10.0.1.37/s734m /media/sambashare cifs  username=####,password=####,defaults 0 0
    This exact line, with the proper edits, might work. For more info:
    Code:
    man fstab
    Last edited by Diabolis; September 9th, 2009 at 06:45 PM.

  3. #3
    Join Date
    Mar 2009
    Location
    Cork, Ireland
    Beans
    239
    Distro
    Ubuntu Development Release

    Re: .sh script, Autostart.sh help

    Thanks for the suggestion, but unfortunately, it seems that fstab doesn't recongnise sshfs, and using cifs comes up with the error
    Code:
    dave@crunch:~$ sudo mount -a
    mount: //192.168.1.1/home/dave is not a valid block device
    man fstab doesn't list sshfs (then again, doesn't list cifs either) but either way, it doesn't understand it. Thanks for the suggestion though
    Acer Aspire T650, 3GHz PIV 1.4Gb RAM ATi Radeon Xpress 200
    320+80GB SATA Ubuntu 9.10 Karmic x86_64 Windows XP Home SP3

    Linux Expresso - Now featuring videos of my systems!

  4. #4
    Join Date
    Mar 2009
    Location
    Cork, Ireland
    Beans
    239
    Distro
    Ubuntu Development Release

    Re: .sh script, Autostart.sh help

    Well, I tried the instructions of how to add SSHFS to fstab as found here, but unfortunately, couldn't get it to work.

    To be honest, I don't mind having to excute the script myself, but what I would like to know is how to excute these three commands in one script, and add a password element to them so that I don't have to key in the password. If it makes any difference, when the commands are run singly form their own .sh scripts, the password is asked for in a small dialog box, titled "OpenSSH".

    I'm seriously confused when it comes to writing .sh scripts, so help would be greatly appreciated.
    Acer Aspire T650, 3GHz PIV 1.4Gb RAM ATi Radeon Xpress 200
    320+80GB SATA Ubuntu 9.10 Karmic x86_64 Windows XP Home SP3

    Linux Expresso - Now featuring videos of my systems!

  5. #5
    Join Date
    Jun 2006
    Beans
    34

    Re: .sh script, Autostart.sh help

    To do it with ssh you must go with ssh 2.0 and a certificate without password.You must have the cert in the client(without it is imposible to login)and authorize it in the server side.

    Here you can find how to configure the certs.

    For you only is interesting the ssh part of the tuto.


    Good luck!
    Last edited by ivelasco; September 9th, 2009 at 07:57 PM.

  6. #6
    Join Date
    Mar 2009
    Location
    Cork, Ireland
    Beans
    239
    Distro
    Ubuntu Development Release

    Re: .sh script, Autostart.sh help

    Quote Originally Posted by ivelasco View Post
    To do it with ssh you must go with ssh 2.0 and a certificate without password.You must have the cert in the client(without it is imposible to login)and authorize it in the server side.

    Here you can find how to configure the certs.

    For you only is interesting the ssh part of the tuto.


    Good luck!
    Right, well thats the password side of things sorted =] But still leaves me with the question of how do I excute three commands with one script?
    Acer Aspire T650, 3GHz PIV 1.4Gb RAM ATi Radeon Xpress 200
    320+80GB SATA Ubuntu 9.10 Karmic x86_64 Windows XP Home SP3

    Linux Expresso - Now featuring videos of my systems!

  7. #7
    Join Date
    Mar 2009
    Location
    Cork, Ireland
    Beans
    239
    Distro
    Ubuntu Development Release

    Re: .sh script, Autostart.sh help

    Right, after all that, a bit more trial and error and I got it. Thanks for the help
    Acer Aspire T650, 3GHz PIV 1.4Gb RAM ATi Radeon Xpress 200
    320+80GB SATA Ubuntu 9.10 Karmic x86_64 Windows XP Home SP3

    Linux Expresso - Now featuring videos of my systems!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •