Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    How to Distribute? (TrueCrypt, Cifs.ko, ntfs.ko, mount.cifs)

    Reply
    Page 12 of 22 | Prev | 2   10     11   12   13     14   | Next | Last
    luigi | # 111 | 2010-01-18, 17:37 | Report

    Originally Posted by Nathan View Post
    Actually this is untrue; the built in File Manager will navigate to anything inside the /media folder. ;-)

    It is considered the "root" folder. So if you use the up arrow, the final location will be listing what is in the /media folder. (Hence the reason why the cifsmount script, and wizard mounter uses it as the base location to mount file shares)

    Nathan
    I'm trying to reproduce this, but don't succeed (N900/2.2009.51-1). If I do (as root) 'mkdir /media/qqq', I don't see the directory 'qqq' with the built-in File Manager, even if I do 'chown -R user /media/qqq'. How come?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    SubCore | # 112 | 2010-01-18, 17:43 | Report

    Originally Posted by luigi View Post
    I'm trying to reproduce this, but don't succeed (N900/2.2009.51-1). If I do (as root) 'mkdir /media/qqq', I don't see the directory 'qqq' with the built-in File Manager, even if I do 'chown -R user /media/qqq'. How come?
    you won't see the directory until something is actually mounted there. the file manager doesn't display directories but mount-points.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to SubCore For This Useful Post:
    luigi

     
    luigi | # 113 | 2010-01-18, 17:59 | Report

    I've read this whole thread from the beginning and I think you've all carried out a marvelous job in bringing such essential feature to this device.

    If I understand well, there are currently two paths to follow: Nathan's kernel-module-cifs and Qole's winfs. The pros and cons of both solutions are not clear to me. Could someone clarify?

    Since I'm a bit uncertain not to break anything, I'd like to know upfront: is it as simple as 1) installing the package, 2) making a mount point, 3) carrying out the appropriate mount command?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qole | # 114 | 2010-01-18, 18:44 | Report

    My winfs package is just a packaging of Nathan's cifs & ntfs modules, along with his mount.cifs command (because I wanted something *right now*). It has been obsoleted by Nathan's own kernel module package.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to qole For This Useful Post:
    cheve, luigi

     
    edivad75 | # 115 | 2010-01-18, 18:51 | Report

    Originally Posted by Cue View Post
    As far as I know (somebody correct me if I'm wrong) the original bourne shell does not have arrays; except one which can be changed with the "set" command. this array initially stores the command line arguments.

    You get the array values with $1 $2 etc, and the size with $#
    I will rewrite GameboyRMH's script for the original bourne shell (/bin/sh) and post it here then he can make the necessary changes.

    I hope you don't mind GameboyRMH.

    Edit: ok, I changed some of it. There are probably some syntax differences I didn't spot but see if it works with this and tell me where it complains

    Code:
    #! /bin/sh
    #arguments: servername serverip share username password mountpoint
    #username, password and mountpoint are optional arguments
    if [ $# -lt 3 ] ; then
        #Go into "wizard mode" if there are no arguments
        echo -e "Not enough arguments passed - running wizard"
        echo -e "Enter the server name:"
        read servername
        echo -e "Enter the server IP"
        read serverip
        echo -e "Enter the share name or path"
        read sharename
        echo -e "Enter a username, or leave blank for anonymous"
        read username
        username_orig=$username
        if [ "${username}" != "" ]; then
            echo -e "Enter a password"
            read password
        fi
        echo -e "Enter a mount point, or leave blank for automatic"
        read mountpoint
    fi
    #if arguments were passed from the command line, use them:
    if [ $# -gt 2 ]; then
        servername=$1
        serverip=$2
        sharename=$3
        username=$4
        username_orig=$username
        password=$5
        mountpoint=$6
    fi
    #set default mountpoint if the user didn't enter one
    if [ "${mountpoint}" = "" ]; then
        mountpoint="/media/Remote_Filesystems/$servername@$sharename"
        #make sure the Remote_Filesystems directory exists
        mountparentdir="/media/Remote_Filesystems"
        if [ -d $mountparentdir ]; then
            echo -e "$mountparentdir found."
        else 
            echo -e "Creating $mountparentdir"
            mkdir $mountparentdir
        fi
    fi
    #requote variables to escape special characters
    servername=$(printf '%q' "$servername")
    serverip=$(printf '%q' "$serverip")
    sharename=$(printf '%q' "$sharename")
    username=$(printf '%q' "$username")
    password=$(printf '%q' "$password")
    mountpoint=$(printf '%q' "$mountpoint")
    #check for mountpoint and create it if it doesn't exist
    if [ -d $mountpoint ]; then
        echo -e "Mount point already exists - will attempt to use."
    else 
        echo -e "Creating mountpoint $mountpoint"
        mkdir $mountpoint
    fi 
    echo -e "Attempting to mount //$servername/$sharename at $mountpoint"
    #Run the mount command
    if [ "${username_orig}" = "" ]; then
    mount -t cifs //$servername/$sharename $mountpoint -o user=$username pass=$password ip=$serverip
    else
    mount -t cifs //$servername/$sharename $mountpoint -o ip=$serverip
    fi
    #chown mountpoint to user
    chown -R user $mountpoint
    echo -e "To unmount this share, run umount $mountpoint as root"
    I have modified the script and now it works:

    Code:
    #! /bin/sh
    #arguments: servername serverip share username password mountpoint
    #username, password and mountpoint are optional arguments
    if [ $# -lt 3 ] ; then
        #Go into "wizard mode" if there are no arguments
        echo -e "Not enough arguments passed - running wizard"
        echo -e "Enter the server name:"
        read servername
        echo -e "Enter the server IP"
        read serverip
        echo -e "Enter the share name or path"
        read sharename
        echo -e "Enter a username, or leave blank for anonymous"
        read username
        username_orig=$username
        if [ "${username}" != "" ]; then
            echo -e "Enter a password"
            read password
        fi
        echo -e "Enter a mount point, or leave blank for automatic"
        read mountpoint
    fi
    #if arguments were passed from the command line, use them:
    if [ $# -gt 2 ]; then
        servername=$1
        serverip=$2
        sharename=$3
        username=$4
        username_orig=$username
        password=$5
        mountpoint=$6
    fi
    #set default mountpoint if the user didn't enter one
    if [ "${mountpoint}" = "" ]; then
        mountpoint="/media/Remote_Filesystems/$servername@$sharename"
        #make sure the Remote_Filesystems directory exists
        mountparentdir="/media/Remote_Filesystems"
        if [ -d $mountparentdir ]; then
            echo -e "$mountparentdir found."
        else 
            echo -e "Creating $mountparentdir"
            mkdir $mountparentdir
        fi
    fi
    #requote variables to escape special characters
    #servername=$(printf '%q' "$servername")
    #serverip=$(printf '%q' "$serverip")
    #sharename=$(printf '%q' "$sharename")
    #username=$(printf '%q' "$username")
    #password=$(printf '%q' "$password")
    #mountpoint=$(printf '%q' "$mountpoint")
    #check for mountpoint and create it if it doesn't exist
    if [ -d $mountpoint ]; then
        echo -e "Mount point already exists - will attempt to use."
    else 
        echo -e "Creating mountpoint $mountpoint"
        mkdir $mountpoint
    fi 
    echo -e "Attempting to mount //$servername/$sharename at $mountpoint"
    #Run the mount command
    if [ "${username_orig}" = "" ]; then
    mount -t cifs //$servername/$sharename $mountpoint -o user=$username,pass=$password,ip=$serverip
    else
    mount -t cifs //$servername/$sharename $mountpoint -o ip=$serverip
    fi
    #chown mountpoint to user
    chown -R user $mountpoint
    echo -e "To unmount this share, run umount $mountpoint as root"
    i have comment the requote of vaiables and i have separate the parameter in mount command after "-o" with comma "," and not with space " "
    i have put the script with exenshions ".sh" in the bin directory and i have run "chmod u+x cifsmount.sh" with root privileges.
    i have execute the script with root privileges
    Sorry for my little english and thanks a lot at All!
    edivad

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to edivad75 For This Useful Post:
    Cue

     
    luigi | # 116 | 2010-01-18, 21:32 | Report

    Originally Posted by SubCore View Post
    you won't see the directory until something is actually mounted there. the file manager doesn't display directories but mount-points.
    Confirmed, thanks!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Cue | # 117 | 2010-01-19, 01:15 | Report

    Originally Posted by edivad75 View Post
    i have comment the requote of vaiables and i have separate the parameter in mount command after "-o" with comma "," and not with space " "
    i have put the script with exenshions ".sh" in the bin directory and i have run "chmod u+x cifsmount.sh" with root privileges.
    i have execute the script with root privileges
    Sorry for my little english and thanks a lot at All!
    edivad
    Thanks edivad.
    commenting out the requotes would work but then wouldn't you have to be careful about what the actual string contains?
    I'm curious about a "printf %q" alternative since I've never thought about how to requote in the bourne shell.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Nathan | # 118 | 2010-01-19, 06:32 | Report

    Well, I've uploaded both TrueCrypt and Samba; and the buildservers built them, but apparently the process to "move" it into the Extras-Devel is currently down. Ergh...

    Nathan

    Edit | Forward | Quote | Quick Reply | Thanks

     
    GameboyRMH | # 119 | 2010-01-19, 13:46 | Report

    Just one correction to that code (the login / anon commands would be chosen incorrectly)

    Code:
    #! /bin/sh
    #arguments: servername serverip share username password mountpoint
    #username, password and mountpoint are optional arguments
    if [ $# -lt 3 ] ; then
        #Go into "wizard mode" if there are no arguments
        echo -e "Not enough arguments passed - running wizard"
        echo -e "Enter the server name:"
        read servername
        echo -e "Enter the server IP"
        read serverip
        echo -e "Enter the share name or path"
        read sharename
        echo -e "Enter a username, or leave blank for anonymous"
        read username
        username_orig=$username
        if [ "${username}" != "" ]; then
            echo -e "Enter a password"
            read password
        fi
        echo -e "Enter a mount point, or leave blank for automatic"
        read mountpoint
    fi
    #if arguments were passed from the command line, use them:
    if [ $# -gt 2 ]; then
        servername=$1
        serverip=$2
        sharename=$3
        username=$4
        username_orig=$username
        password=$5
        mountpoint=$6
    fi
    #set default mountpoint if the user didn't enter one
    if [ "${mountpoint}" = "" ]; then
        mountpoint="/media/Remote_Filesystems/$servername@$sharename"
        #make sure the Remote_Filesystems directory exists
        mountparentdir="/media/Remote_Filesystems"
        if [ -d $mountparentdir ]; then
            echo -e "$mountparentdir found."
        else 
            echo -e "Creating $mountparentdir"
            mkdir $mountparentdir
        fi
    fi
    #requote variables to escape special characters
    #servername=$(printf '%q' "$servername")
    #serverip=$(printf '%q' "$serverip")
    #sharename=$(printf '%q' "$sharename")
    #username=$(printf '%q' "$username")
    #password=$(printf '%q' "$password")
    #mountpoint=$(printf '%q' "$mountpoint")
    #check for mountpoint and create it if it doesn't exist
    if [ -d $mountpoint ]; then
        echo -e "Mount point already exists - will attempt to use."
    else 
        echo -e "Creating mountpoint $mountpoint"
        mkdir $mountpoint
    fi 
    echo -e "Attempting to mount //$servername/$sharename at $mountpoint"
    #Run the mount command
    if [ "${username_orig}" != "" ]; then
    mount -t cifs //$servername/$sharename $mountpoint -o user=$username,pass=$password,ip=$serverip
    else
    mount -t cifs //$servername/$sharename $mountpoint -o ip=$serverip
    fi
    #chown mountpoint to user
    chown -R user $mountpoint
    echo -e "To unmount this share, run umount $mountpoint as root"
    Can anyone confirm a successful mount?

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to GameboyRMH For This Useful Post:
    maartenmk

     
    tuxian | # 120 | 2010-01-19, 13:59 | Report

    I would like to tunnel my ssh port with ssh to be able to mount ist.

    I use the command

    ssh -X -L 139:localhost:139 user@myserver

    which works fine.
    When I uses nmap I see port 139 opened local.

    But mounting doesn't work.

    I use this command:

    mount.cifs //localhost/data /mnt -ouser=myuser,ip=127.0.0.1

    Then I get the message "Host is down".

    Any suggestions?

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to tuxian For This Useful Post:
    qole

     
    Page 12 of 22 | Prev | 2   10     11   12   13     14   | Next | Last
vBulletin® Version 3.8.8
Normal Logout