Note: This will add the remote server to root's list of known_hosts. Servername -fstype=curl,allow_other :ftp\://remoteserverĬreate the file /sbin/mount.curl with this code:Ĭreate the file /sbin/umount.curl with this code:Īfter a restart your new FTP server should be accessible through /media/ftp/servername. The line in /etc/autofs/auto.ftp looks like this without user and password: This method is also less sensitive to special characters (that else must be escaped) in the passwords. Passwords are still plain text, but you can have mode 600, and df command will not show them (mounted or not). If you want slightly more security you can create the file ~root/.netrc and add the passwords there. Note: Your passwords are plainly visible for anyone that can run df (only for mounted servers) or view the file /etc/autofs/auto.ftp. You can specify a user name and password to use with the share in the other_options section: The -browse option creates empty folders for each mount-point in the file in order to prevent timeouts, if a network share cannot be contacted. Where -timeout defines how many seconds to wait before the file system is unmounted. etc/autofs//file_tofs /mnt /etc/autofs/auto.file_server -timeout 60 /etc/autofs/auto.file_server foo -rw,soft,rsize=8192,wsize=8192 file_server:/srv/shared_dir Samba Single sharesĪdd the following to /etc/autofs/auto.master: To mount a NFS share for file_server on /srv/shared_dir at location /mnt/foo, add a new configuration, e.g. You can see the exported shares by typing: The -hosts option uses a similar mechanism as the showmount command to detect remote shares. automatically creating directory placeholders before mounting shares) is enabled by default although, AutoFS installation notes claim to remove that option from /etc/conf.d/autofs in order to start the AutoFS daemon. To enable automatic discovery and mounting of network shares from all accessible servers without any further configuration, you will need to add the following to the /etc/autofs/auto.master file: if /dev/sd" >/etc/autofs/auto.mntĪutoFS provides automatically discovering and mounting NFS-shares on remote servers (the AutoFS network template in /etc/autofs/ has been removed in autofs5). Removable devices are assigned block device locations according to the next available spot, e.g. When you are done configuring your templates (see below), launch the AutoFS daemon as root by enabling and starting the rvice.ĭevices are now automatically mounted when they are accessed, they will remain mounted as long as you access them. Open the file /etc/nf and add an entry for automount: To mitigate this, only use if you will always be connected to the share, and do not use your home folder or other commonly used folders lest your file browser reads ahead into the disconnected folder When trying to access the folder, programs will get locked into waiting for a response, and either the connection has to be restored or the process has to be forcibly killed before unmounting is possible. Note: This can cause problems with resources getting locked if the connection to the share is lost. home/user/usbstick -fstype=auto,async,nodev,nosuid,umask=000 :/dev/sdb1 etc/autofs/auto.master /- /etc/autofs/auto.template /etc/autofs/auto.template /path/to/folder -options :/device/path # ln -s /var/autofs/net/share_name /media/share_nameĪlternatively, you can have autofs mount your media to a specific folder, rather than inside a common folder. If you still want to automount to a target non-empty directory and want to have the original files available even after the dynamically loaded directories are mounted, you can use autofs to mount them to another directory (e.g. This procedure is however non-destructive, so if you accidentally automount into a live directory you can just change the location in auto.master and restart AutoFS to regain the original contents. The base directory will be mounted on to load the dynamically loaded media, which means any content in the base directory will not be accessible while autofs is on. The base directory will be created if it does not exist on your system. Setting this value to 0 will disable the timeout. Tip: The optional parameter timeout sets the amount of seconds after which to unmount directories.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |