Showing posts with label File Sharing Servers. Show all posts
Showing posts with label File Sharing Servers. Show all posts

8 Ways To Mount SMBfs (SAMBA FILE SYSTEM) In Linux.

0 comments

How to Mount smbfs (SAMBA file system) permanently in Linux.In this post I am going to give some examples how to do SMB (Server Message Block) mounts..

Type1 : Listing SMB shared folder through command prompt
#smbclient –L ipadd –U username
Here –L will specify listing of SMB share for the server with ipadd
Or
#smbclient //192.168.0.1/share1 –U username

Example :
#smbclient –L 192.168.0.1 –U root

Type2 : Mounting SMB share on local folder by using smbmount command
#smbmount //ipadd/sharename /mountpoint –o username=userid,workgroup=workgroupname
Example :
#smbmount //192.168.0.1/share1 /mnt –o username=steev,workgroup=test

Type3 : Mounting SMB share by using mount command
#mount –t smbfs ipadd:/sharename /mountpoint –o username=userid,workgroup=workgroupname
Or
#mount –t smbfs //ipadd/sharename /mountpoint –o username=userid,workgroup=workgroupname

Example :
#mount –t smbfs 192.168.0.1:/share1 /mnt –o username=surendra,workgroup=test

Type4 : Mounting CIFS (Common Internet File System) is nothing but a advanced SMB file system implementation which support RAP (Remote Access Protocol)
#mount –t cifs ipadd:/sharename /mountpoint –o username=userid,workgroup=workgroupname

Example :
#mount –t cifs 192.168.0.1:/share1 /test –o username=Surendra,workgroup=test


Type5 : All the above commands will ask password to display/mount the share name, however we can specify the password in command itself as below
#mount -t smbfs -o username=userid,workgroup=workgroupname,password=XXXXX //ipadd/sharepoint /mountpoint/

Example :
#mount –t smbfs –o username=Surendra,workgroup=test,password=xylBJRS8 //192.168.0.1/share1 /test

Type6 : Mounting permanently by editing /etc/fstab file, below is the fstab file entry example
#vi /etc/fstab//192.168.0.1/share1 /test smbfs rw,user,username=surendra,password=xylBJRS8 0 0
Save and exit the file and conform that you edited fstab file properly. By below commands
#mount –a
This command should not through any error,
#df –H
This command should show mount from 192.168.0.1 server

Type7 : Mounting a share where user belongs to a domain permanently by editing /etc/fstab file
The above command will not work properly for domain users so we have to specify domain as well when specifying username
So now username will be changed to domain\username
#vi /etc/fstab
//192.168.0.1/share1 /mnt smbfs rw,user,username=test\surendra,password=xylBJRS8 0 0
Save the file and exit then execute mount –a and df –H for just conformation if the mount is done successfully.

Type8:As you people know /etc/fstab file is visible to all the users who logged in, so specifying user password in /etc/fstab file is not that much good procedure.. So there is a work around to resolve this issue, just create a credential file in users home directory and point that file in /etc/fstab file entry as mention below.
#cd ~
#echo username=surendra > .smbfile
#echo password=xylBJRS8 >> .smbfile
#chmod 600 .smbfile
Then edit the /etc/fstab file and specify the entries as below
#vi /etc/fstab
//192.168.0.1/share1 /mnt smbfs credentials=/home/myhomedirectoryofuser/. smbfile,rw,user 0 0
Save and exit the file and execute mount –a, df –H to check if you did any mistakes..

Please comment your experience on SMB.


  • Like the post? Please Subscribe to free RSS feed to get updates
  • RSYNC --The tool every Admin should know

    0 comments

    Recently I came accross rsync utility... Its an awesome command it is a sub service under xinetd along with some other services such as tftp, rcp, rsh, rlogin, telnet etc..

    Let us list advantages of this command then we will know how to configure it.

    Advantages of rsync :


    1. This tool will keep both the destination and source folder synced.
    2. rsync is fast, because it will not copy entire data every time it got synced, it just copes the date which got changed from previous copy.
    3. For security reasons, rsync will support ssh to transfer data between two machines.
    4. rsync is used to download RPM updated repository to local machine.
    And lot more advantages are there.. please share your valuable experiences here.

    Configuration : rsync

    Some points to be remembered when dealing with rsync

    • This utility is the part of xinetd so there is no special package for this.
    • When we are doing rsync between two systems, both the systems should be configured to allow rsync connections.
    • rsync uses 873.
    Step1 : Install xinetd package, if you want to configure yum server click here.
    #yum install xinetd

    Step2 : Configure rsync to allow connections, the configuration file for rsync is located in /etc/xinetd.d
    #cd /etc/xinetd.d
    #vi rsync


    # default : off
    # description: The rsync server is a good addition to an ftp server, as it \
    # allows crc checksumming etc.
    service rsync
    {
    disable = yes
    socket_type = stream
    wait = no
    user = root
    server = /usr/bin/rsync
    server_args = --daemon
    log_on_failure += USERID
    }
    In this configuration file just change disable = yes to no, then save the file and exit. Here is the updated configured file.
    # description: The rsync server is a good addition to an ftp server, as it \
    # allows crc checksumming etc.
    service rsync
    {
    disable = no

    socket_type = stream
    wait = no
    user = root
    server = /usr/bin/rsync
    server_args = --daemon
    log_on_failure += USERID
    }

    Step3 : Start the rsync service, so how to do it? As i mention earlier that rsync is a part of xinetd service so just restart the xinetd service.
    #service xinetd restart

    Step4 : Permanently on the service
    #chkconfig rsync --levels 345 on

    Same configurations should be done on the other system too, in order to rsync executed properly.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Server configuration file syntax Checking commands

    2 comments

    SERVER CONFIGURATION FILE SYNTAX CHECKING COMMANDS.

    I have planned to write this post some long time ago, now the time has come to do it.

    Basically configuring servers in Linux/*nix include editing of configuration files and saving them. Once editing the files if any syntax error is there and when we start the service they will show some wearied errors which we cant resolve.
    For counter attacking this type of issues for each service there will be one command to check this syntax errors before starting of the service/server, I have collected these commands from my experience and from some of my friends. Please feel free to comment on this if you know some other commands so that I will update my post.

    SSHD server check for syntax error
    =========================
    sshd -t

    FTP server check for syntax error
    =========================
    #vsftpd

    DNS server check for syntax error
    ==========================

    For checking syntax errors in main configuration file..
    #named-checkconf main-config-file

    Example:
    #named-checkconf named.conf

    Syntax OK

    #named-checkzone domain zonefile-loc

    Example:
    #named-checkzone example.com /var/named/chroot/var/named/exaple-zone.frd

    SAMBA server check for syntax error
    =============================
    #testparm

    APACHE server check for syntax error
    =============================
    httpd -t

    For virtual hosts

    httpd -t -D DUMP_VHOSTS

    TCP Wrappers check for syntax error
    ============================
    tcpdchk
    tcpdchk -v


    Postfox server check for syntax error
    ============================
    postfix check
    postfix -vv


    LIGHTTPD
    server check for syntax error
    =============================
    lighttpd -t -f /etc/lighttpd/lighttpd.conf

    Squid
    server check for syntax error
    ==========================
    squid -k check
    squid -k parse


    NAGIOS server check for syntax error
    ====================================
    /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Linux interview questions :FTP

    6 comments

    LINUX INTERVIEW QUESTIONS : FTP

    One of my friend asked me why there is no answers for So many interview questions, basically most of the interview questions which are on this site are the interviews which happened to me so. At that time I am not able to Answer some of the questions, so from today on words I will try to post all the interview questions with answers, If you feel these answers are wrong you can feel free to comment with proof so that i can modify my posts.

    1)What is the difference between TFTP and FTP servers?
    A)Both are file transfer servers but slight difference is TFTP server uses UDP protocol and FTP uses TCP protocol. TFTP is good for slow connection paths.

    2)What is the port no for FTP?
    A)20 for Data and 21 for Control(normally when an interviewer ask's ftp port number just say 21.

    3)What is the port no for TFTP?
    A)69.

    4) How to restrict users to their home directories?
    A)
    By setting up "chroot_local_user=YES".


    5)How to restrict total number of users accessing FTP server?
    A1)
    If Vsftpd is running under xinted service, then you can use xineted to get per-service per IP connection limits or
    A2) If you run vsftpd in "standalone" mode with the "setting listen=YES", then
    you can investigate the setting (e.g.) : "max_clients=10"


    6)I want to copy multiple files with out prompting for any info, how can I do that one?
    A)Simply do "ftp -i ftpserver" this command will suppress any info displayed on ftp server.
    or you can just type prompt ftp prompt to suppress info messages have a look here.

    7) Some times Local users cannot log in. How to resolve this issue?
    A)
    Check "local_enable=YES" in your /etc/vsftpd/vsftpd. conf to allow local users to log in.

    8) How do we integrate with LDAP( Lightweight Directory Access Protocol )users and login?
    A)
    Use vsftpd's( Very Secure FTPD) PAM(Pluggable Authentication Modules) integration to do this, and have PAM authenticate against an LDAP repository.


    9) Can we host different ftp sites on single machine, I mean virtual hosting concept like Apache?
    A1)
    Yes. If you integrate vsftpd with xinetd, you can use xinetd to bind to several different IP addresses. For each IP address, get xinetd to launch vsftpd with a different config file. This way, you can get different behavior per virtual address.
    A2) Alternatively, run as many copies as vsftpd as necessary, in standalone
    mode. Use "listen_address=x.x.x.x" to set the virtual IP.


    10) How to restrict different users with different permissions in vsftpd
    A) By setting up "user_config_dir" entry in "vsftpd.conf".


    11)How to change vsftpd default port?
    A)By setting "listen_port" option in "vsftpd.conf".

    12) Vsftpd is reporting times as GMT times and not local times!. How to resolve this?
    A)
    This behavior can be changed with the setting "use_localtime=YES".



    13) How to disable certain FTP commands?
    A) There are some individual settings (e.g. dirlist_enable) or you can specify a complete set of allowed commands with "cmds_allowed".


    14) How does vsftpd support per-IP limits?
    A1)
    If you are running vsftpd standalone, there is a "max_per_ip" setting.
    A2) Yes. If you are running vsftpd via xinetd, there is an xinetd config variable "per_source".


    15) How Does vsftpd can do bandwidth limiting?
    A)
    settings such as "anon_max_rate" and "local_max_rate" can be used to set this limits.


    16) How to restrict some IP's not use my FTP server?
    A1)
    vsftpd can integrate with tcp_wrappers (if built with this support). It is enabled with the setting "tcp_wrappers=YES".

    17) Does vsftpd support IPv6?
    A)
    Yes, as of "version 1.2.0".


    18) Help! I'm getting messages along the lines of "500 OOPS: vsf_sysutil_bind" when trying to do downloads (particularly lots of small files).
    A) "vsftpd-1.2.1"
    should sort this out.


    19) Can we use vsftpd to hiding or denying certain files?
    A)
    Yes. Look at the hide_file and deny_file options.


    20)How you can check if there is any syntax error in vsftpd.conf file?
    A)Just type vsftpd with out quoats.


  • Like the post? Please Subscribe to free RSS feed to get updates
  • Archive

    Translate this page

     

    The Linux Juggernaut | Copyright 2006-2009 Surendra Kumar Anne | Surendra's Home Page | Give us feedback how we are doing, Click here