Saturday, April 26, 2014

Install and Configure Samba Server on OpenSUSE 13.1



Samba is a free and open-source software package that provides seamless file and print services to SMB/CIFS clients. Samba is freely available, unlike other SMB/CIFS implementations and allows for interoperability between Linux/Unix servers and Windows OS-based clients. Using Samba we can easily share files and folders between GNU/Linux and Windows OS systems.
In this tutorial we are going to implemenSamba server on OpenSUSE 13.1.
Install Samba
Login as root user:
> su
Install Samba with following command:
# zypper install samba*
Configure Fully Accessed Anonymous Share
Let us create directory /share1 and set full permission. Anybody can access this share:
# mkdir /home/suraj
# chmod -R 777 /home/suraj
Open up Samba configuration file /etc/samaba/smb.conf file:
# vi /etc/samba/smb.conf
And edit as follows;
Make sure that you have the following line in [global] section. If not found, just add it as shown below:
[...]
passdb backend = tdbsam
[...]
Scroll down further and add this share details at the bottom of the Samba configuration file:
[Full Share]        
         path = /home/suraj
         writable = yes 
         browsable = yes 
         guest ok = yes 
         guest only = yes 
         create mode = 0777 
         directory mode = 0777
Save and close the file. Enable and start Samba service to save the changes:
# systemctl enable smb.service
# systemctl enable nmb.service

# systemctl start smb.service
# systemctl start nmb.service
Test Samba Configuration
Execute the following command to verify the Samba configuration file. It displays the errors if we have any:
# testparm
The above command will display the output as shown below:
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Can't find include file /etc/samba/dhcp.conf
Processing section "[homes]"
Processing section "[profiles]"
Processing section "[users]"
Processing section "[groups]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[Full Share]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
     map to guest = Bad User
     printcap name = cups
     logon path = \\%L\profiles\.msprofile
     logon drive = P:
     logon home = \\%L\%U\.9xprofile
     usershare allow guests = Yes
     idmap config * : backend = tdb
     cups options = raw

[homes]
     comment = Home Directories
     valid users = %S, %D%w%S
     read only = No
     inherit acls = Yes
     browseable = No

[profiles]
     comment = Network Profiles Service
     path = %H
     read only = No
     create mask = 0600
     directory mask = 0700
     store dos attributes = Yes

[users]
     comment = All users
     path = /home
     read only = No
     inherit acls = Yes
     veto files = /aquota.user/groups/shares/

[groups]
     comment = All groups
     path = /home/groups
     read only = No
     inherit acls = Yes

[printers]
     comment = All Printers
     path = /var/tmp
     create mask = 0600
     printable = Yes
     print ok = Yes
     browseable = No

[print$]
     comment = Printer Drivers
     path = /var/lib/samba/drivers
     write list = @ntadmin, root
     force group = ntadmin
     create mask = 0664
     directory mask = 0775

[Full Share]
     path = /home/suraj
     read only = No
     create mask = 0777
     directory mask = 0777
     guest only = Yes
     guest ok = Yes
I don’t want to mess up iptables, so i turned it off:
# rcSuSEfirewall2 stop
Test Anonymous Samba Share on Windows OS Client
Login to Windows OS machine and go to Start -> Run. Enter the IP address of your Samba server.
Now you’ll able to access the fully accessed Samba share from your Windows OS clients.
Create some files and folders in side the share. In my case, I created a folder called linux in my fully accessed anonymous Samba share called Full Share.
Create an Authenticated Share
Let us create a Samba user called sk under Samba group called smbgroup:
# useradd suraj
# passwd suraj

# groupadd smbgroup
# usermod -a -G smbgroup suraj
Now assign the user sk to Samba user database with following command:
# smbpasswd -a suraj
New SMB password:
Retype new SMB password:
Added user suraj.
Create a new share called /share2 and assign this share to smbgroup, so that the users of smbgroup can access the /share2directory:
# mkdir /home/open-share
# chmod -R 755 /home/open-share
# chown -R suraj:smbgroup /home/open-share
Add the above /home/open-share directory details in Samba configuration file as shown below;
Open up samba configuration file:
# vi /etc/samba/smb.conf
Add the /share2 details at the end:
[open-share]
        path = /home/open-share 
        writable = yes 
        browsable = yes 
        guest ok = no 
        valid users = @smbgroup
Restart Samba service to save the changes:
# systemctl restart smb.service
# systemctl restart nmb.service
Now test the configuration file with following command:
# testparm
You may see the following like output:
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Can't find include file /etc/samba/dhcp.conf
Processing section "[homes]"
Processing section "[profiles]"
Processing section "[users]"
Processing section "[groups]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[Full Share]"
Processing section "[open-share]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
    map to guest = Bad User
    printcap name = cups
    logon path = \\%L\profiles\.msprofile
    logon drive = P:
    logon home = \\%L\%U\.9xprofile
    usershare allow guests = Yes
    idmap config * : backend = tdb
    cups options = raw

[homes]
    comment = Home Directories
    valid users = %S, %D%w%S
    read only = No
    inherit acls = Yes
    browseable = No

[profiles]
    comment = Network Profiles Service
    path = %H
    read only = No
    create mask = 0600
    directory mask = 0700
    store dos attributes = Yes

[users]
    comment = All users
    path = /home
    read only = No
    inherit acls = Yes
    veto files = /aquota.user/groups/shares/

[groups]
    comment = All groups
    path = /home/groups
    read only = No
    inherit acls = Yes

[printers]
    comment = All Printers
    path = /var/tmp
    create mask = 0600
    printable = Yes
    print ok = Yes
    browseable = No

[print$]
    comment = Printer Drivers
    path = /var/lib/samba/drivers
    write list = @ntadmin, root
    force group = ntadmin
    create mask = 0664
    directory mask = 0775

[Full Share]
    path = /share1
    read only = No
    create mask = 0777
    directory mask = 0777
    guest only = Yes
    guest ok = Yes

[open-share]
    path = /home/open-share
    valid users = @smbgroup
    read only = No
Test Authenticated Share on Windows OS Client
Now go to the Windows OS client and check the authenticated share. It will ask you to enter username and password to access the Samba shares. Enter the username and password that you have created earlier. You’re done!
That’s it. Now you’ll able to access the Samba shares.

Saturday, March 2, 2013

How to Backup and Restore MySQL database in Linux



To take a backup of MySQL database or databases, the database must exist in the database server and you must have access to it. The format of the command would be.
# mysqldump -u [username] –p[password] [database_name] > [dump_file.sql]
The parameters of the said command as follows.
  1. [username] : A valid MySQL username.
  2. [database_name] : A valid Database name you want to take backup.
  3. [dump_file.sql] : The name of backup dump file you want to generate.
Example, Backup Database  :- 

# mysqldump -u suraj –p moodle > /home/suraj/moodle.sql
Example, Restore Database  :-
# mysql -u suraj –p moodle < /home/suraj/moodle.sql

Changing Apache2 Default Port in UBUNTU

Task: Change Apache port

Open /etc/apache2/ports.conf file, enter:
# vim /etc/apache2/ports.confOR
$ sudo vim /etc/apache2/ports.conf
To make the server accept connection on  port 81, enter:
Listen 81
Save and close the file And Open /etc/apache2/sites-enabled/000-default  :
# vim /etc/apache2/sites-enabled/000-default< VirtualHost *:80>  TO < VirtualHost *:81>
Save and close the file. Restart Apache 2 web server:
# /etc/init.d/apache2 restart
OR
$ sudo /etc/init.d/apache2 restart






Thursday, October 4, 2012

Install lamp with 1 command in Ubuntu 12.04, 12.10 QuantalQuetzal & LinuxMint13

LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform that uses Linux as operating system, Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language.
We did show you in our previous post how to install LAMP in Ubuntu 10.04 with one command using tasksel command. It is a software installation application that is an integral part of the Debian installer and works under Ubuntu Linux too. It groups some packages by tasks and offers the user an easy way to install the packages for that task. It provides the same functionality as using conventional meta-packages. in Maverick this command dosn`t come by default, so we need to install it first before to perform the LAMP installation.

This tutorial was has been tested on Ubuntu 10.04, 10.10, 11.04, 11.10, 12.04 LTS Precise Pangolin. Also tested in LinuxMint13 and works fine.
Open terminal and Type the command :install it   first  with

$sudo apt-get install tasksel
 
Now to install LAMP, type the taskel command in terminal :

$sudo  tasksel
 
And select LAMP Server:




During the installation  you  will be  asked  to insert the  mysql root  password



Now check if php is working :


$sudo vi /var/www/info.php
 
and add

phpinfo();
?>
 
save and exit
restart apache2 ,

#sudo /etc/init.d/apache2 restart
 
Now open browser and type :

http://ip/info.php or http://localhost/info.php
 

Php is installed.

To full manage  your  lamp Server database, install  phpmyadmin 

sudo  apt-get  install  phpmyadmin
 
To login  to phpmyadmin, open browser and type :

http://ip/phpmyadmin   or http://localhost/phpmyadmin


{module user9-footer|none}

Saturday, October 1, 2011

Big Blue Button Server Installation

  • UBUNTU 10.04 LTS Installation
  • Installation Of Basic Packages For Video Transmitting
  • Big Blue Button Server Installation

Requirements :-
  1. An Ubuntu 10.04 32-bit or 64-bit server
  2. 2 GB of memory
  3. Root access to the server
  4. 5G of free disk space
  5. Port 80 is not in use by other applications

Step 1 :- Install UBUNTU 10.04 On server Machine.
Step 2 :- Install All Basic Packages. ( Office, k3b, flash player etc.)
Step 3 :- Install the BigBlueButton apt-get repository key Using following command

# Install the package key
wget http://ubuntu.bigbluebutton.org/bigbluebutton.asc -O- | sudo apt-key add -

# Add the BigBlueButton repository URL and ensure the multiverse is enabled
echo "deb http://ubuntu.bigbluebutton.org/lucid/ bigbluebutton-lucid main" | sudo tee /etc/apt/sources.list.d/bigbluebutton.list

echo "deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse" | sudo tee -a /etc/apt/sources.list

Step 4 :- Install a Voice Conference Server

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:freeswitch-drivers/freeswitch-nightly-drivers
sudo apt-get update
sudo apt-get install bbb-freeswitch-config

Step 5 :- Install Big Blue Button.

sudo apt-get install bigbluebutton

Step 5 :- Do a clean Restart.
To ensure BigBlueButton has started cleanly, enter the following commands:

sudo bbb-conf --clean
sudo bbb-conf --check

  • AUDIO Problem Solution :-
sudo bbb-conf --check

sudo bbb-conf --clean

Monday, March 21, 2011

Configuring NetConnect on Ubuntu 10.04

This is a basically just a simple guide on how to use your Reliance/tata indicom Netconnect Broadband+ connection in Linux . I am not expert in Linux ,but I managed to configure and connect in Linux quiet easily .

So here’s what you do .

Stuff you Require

1. USB modem/Data Card with activated connection along with your password and username.

2. Machine with Linux installed

3. ubuntu 10.04 DVD

4. wvdial ( A generic software client in Linux)

To install wvdial

a) If you do have an alternate internet connection in Linux . Open a terminal and type in

sudo apt-get install wvdial (with your alternate internet activated)

b) If you don’t have an alternate internet connection

Go to System->Administration->software sources. Add cd as a source and close . Insert your Linux OS CD .Now open a terminal and type in

sudo apt-get install wvdial

Procedure

Activating your connection

1) First get your connection activated and connect it to the internet using a windows or an Apple machine . Open up a web page just to make sure that its active .

Pre-Configuration Procedures

2) Boot up Linux

3) Open up a terminal and key in su (Stands for Super user and it gives you administrative privileges )

4) Plugin your USB modem and unplug any other devices you have installed (including any wired/wireless internet connections you may have).

5) Next key in lsusb (This command lists all the usb devices currently connected to your system )

Your output should be similar to this

Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 12d1:1412 Huawei Technologies Co., Ltd.
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

It may vary slightly depending on your modem make (Huawei or quallcom).

6) Make sure to note down the number that you get . Here for example it would be 12d1:1412

7) Next key in modprobe usbserial vendor=0x12d1 product=0×1412 ,

make sure that the number you enter for your vendor and product are the number you got for your lsusb command.

Configuring software client wvdial

Now we are going to use wvdial in Linux to connect to the internet .wvdial is just a generic internet client which can be used to connect to any internet connection that requires dialing . For example : your landline Dialup connection or in our case a mobile broadband internet Its kind of like an all purpose internet client software.

8 ) open up wvdial’s configuration file using this command

gedit /etc/wvdial.conf
9) Paste the below code into the window that pops up ( make sure to enter your relevant details ).

[Dialer Defaults]

Init1 = ATZ

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

Stupid Mode = 1

Modem Type = USB Modem

ISDN = 0

Phone = #777

New PPPD = yes

Modem = /dev/ttyUSB0 (This may also be dev/ttyUSB2 depending on where you plugged in your device)

Username = 9xxxxxxxxxx (your username, should be a number )

Password = 9xxxxxxxxxx (Your password , should be the same number)

CBaud = 460800

Delete all the comments in the brackets . The fields you should edit are Modem , Username and password the only ones with comment .

Save and exist .

10) That’s it ! your done , that was simple was nt it ?

Fire up a new Terminal and key in sudo wvdial , enter your root password in the password prompt . it should generate a long list of codes finally ending with Primary DNS Secondary DNS . If it does you have got your connection working successfully ! enjoy.

Closing your connection :

You can disconnect your client by selecting your terminal and pressing Ctrl+C

Friday, January 7, 2011

Remote Desktop Sharing in Ubuntu

Configuring Remote Desktop

First you need to go to system -> Preferences -> Remote Desktop

Once it opens you should see the following screen

In the above screen you need to configure remote desktop preferences for sharing and security

For Sharing

you need to tick the box next to the following two options

Allow other users to view your desktop
Allow other users to control your desktop

For Security

you need to tick the box next to the following two options

Ask you for confirmation (If you tick this option some one need to click on allow from remote desktop once it connected if you don’t want you can untick this option)
Require the user to enter this password:
Password: Specify the password

Connecting from Ubuntu Machine

Open your terminal from Applications—>Accessories—>Terminal and enter the following command

vncviewer -fullscreen 192.168.2.23:0

now you should see the following message asking for password enter the password after complete success you can see VNC authentication succeeded message and starting remote desktop

VNC viewer version 3.3.7 – built Jul 4 2006 10:04:48
Copyright (C) 2002-2003 RealVNC Ltd.
Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
See http://www.realvnc.com for information on VNC.
VNC server supports protocol version 3.7 (viewer 3.3)
Password:
VNC authentication succeeded

If you want to quit vncviewer

Press ‘F8′ and select Quit viewer

Connecting from Windows machine

If you are trying to connect from your windows machine you need to install vncviewer of your choice i have installed from here http://www.realvnc.com/download.html. Install program once you install this you can opem from start—>All programs—>RealVNC—>VNC Viewer 4—>Run VNC Viewer once it opens you should see the following screen here enter the remote machine ipaddress:0 format and click OK

Now it will prompt for password enter your password and click OK

Now on the remote machine you should see the following screen asking for permission to allow this connection you need to click on allow this will come up only if you tick “Ask you for confirmation” option under sharing

Once it connected you should see the remote machine desktop like the following screen