How to installation Oscam On Linux Server

What you will need:

1. A PC (moderate power ).
2. A Smartcard reader
3. A valid smartcard

Skip Step 1 to 7, if you already have Debian server running and ftp server installed[


1. Download the latest Debian CD from here:

http://cdimage.debian.org/cdimage/we...-i386-CD-1.iso

2. Install using the default options. When prompted for features, untick "Desktop Environment", and tick "SSH Server".

3. Log in and switch to the 'root' user:

su root

4. Set a static IP address:

a. Backup original config:
cp /etc/network/interfaces /etc/network/interfaces.bak

b. Edit the file:
nano/etc/networking/interfaces

c. Edit the file such that the iface etho entry looks like this:

iface eth0 inet static
address 192.168.10.6
gateway 192.168.10.1
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255

5. Log out of the console session:

exit

6. You can now ssh into 192.168.0.6 using putty. After you login:

su root

7. OPTIONAL Install ftp server:

apt-get install vsftpd

Backup the original configuration file:

cp /etc/vsftpd.conf /etc/vsftpd.conf.ORIG

Open /etc/vsftpd.conf in an editor:

nano /etc/vsftpd.conf

To configure vsftpd to authenticate system users and allow them to upload filesuncomment the lines:

local_enable=YES
write_enable=YES

Now restart vsftpd:

/etc/init.d/vsftpd restart

8. Install oscam:
Code:
cd /lib/

ln -s libcrypto.so.0.9.8e libcrypto.so.0.9.8

apt-get install yum bzip2 gcc g++ cmake libpcsclite1 libpcsclite-dev subversion make

cd /usr/src

wget http://cdnetworks-us-2.dl.sourceforg...-1.0.8.tar.bz2

tar xjvf libusb-1.0.8.tar.bz2

cd libusb-1.0.8

./configure --enable-shared=no

make

make install

cd /usr/src

svn co http://streamboard.gmc.to/svn/oscam/trunk oscam

cd oscam

mkdir build

cd build

cmake -DWEBIF=1 ..

make install


9. Create oscam config files

Code:
nano /usr/local/etc/oscam.server

"copy below text into file as sample"

[reader]
label=reader1
protocol=SmartReader
detect=CD
group=1
emmcache=1,1,2
device=Serial:Reader XXX
caid=096C
boxid=XXXXXXXX

**To determine what to put in the oscam.server boxid= line:
a. Get your 11 digit box serial (101*******5)
b. Remove the last digit (101*******) and type it in the windows calculator in dec mode
c. Click hex - this will give you the 7 or 8 digit hex to replace the xxxxxxxx's with


**To determine what to put in the oscam.server device= line:

a. Ensure your smartcard reader is running.
b. Insert the reader into a usb port on the server.
c. Now that oscam is actually installed you can point a web browser to 192.168.0.6:8888 (or whatever ip address you gave the server). User Name is username, Password is password.
d. When you have accessed the web interface successfully, go to the "Readers" section and click the "Scan USB" link. Output will be something like:

Bus 001 Device 003: ID 0403:6001 USB-Serial (UART) IC
iProduct 0
iSerial 3 Reader 67
In the example output above the "iSerial 3 Reader 67" is of interest to us. Change the line:

device=Serial:Reader XXX

To:

device = Serial:Reader 67


Code:
nano /usr/local/etc/oscam.conf

"copy below text into file as sample"

[global]
nice = -19
WaitForCards = 1
saveinithistory = 1

# logging
pidfile = /var/run/oscam.pid
logfile = /var/log/oscam.log
usrfile = /var/log/oscamuser.log
cwlogdir = /var/log/cw.log
maxlogsize = 1000

[newcamd]
key = 0102030405060708091011121314
port = 10000@096c:000000;

# web interface
[webif]
httpport = 8888
httpuser = username
httppwd = password
httpallowed = 0.0.0.0-255.255.255.255





Code:
nano /usr/local/etc/oscam.user

"copy below text into file as sample"

[account]
user = username
pwd = password
uniq = 1
group = 1
au = reader1
ident = 096c:000000
caid = 096c


10. Make oscam start and stop automatically with server bootup/shutdown. Create script:

Code:
nano /etc/init.d/oscam


Copy and paste below code.

#!/bin/sh
# Start/stop the OScam daemon.
#
### BEGIN INIT INFO
# Provides: OScam
# Required-Start: $syslog $network $pcscd
# Required-Stop: $syslog $network $pcscd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and Stop OScam
# Description: OScam init script. This script start and stop OScam.
### END INIT INFO

. /lib/lsb/init-functions

NAME=oscam
DAEMON=/usr/local/bin/$NAME
CONFIG_DIR=/usr/local/etc
PIDFILE=/var/run/oscam.pid
LOG=/var/log/oscam.log
LOGUSR=/var/log/oscamuser.log
LOGCW=/var/log/cw.log
STARTAS="$DAEMON -- -b -c $CONFIG_DIR"

#test -f $DAEMON || exit 0

[ -d $CONFIG_DIR ] || exit 0

echo $NAME

clear_file() {
# Clear log and pid file if exists
if [ -e $PIDFILE ]
then
rm -f $PIDFILE
fi
if [ -e $LOG ]
then
rm -f $LOG
fi
if [ -e $LOGUSR ]
then
rm -f $LOGUSR
fi
if [ -e $LOGCW ]
then
rm -f $LOGCW
fi
}
case "$1" in
start)
clear_file
log_daemon_msg "Starting OScam daemon" "OScam"
start-stop-daemon --start --quiet --exe $DAEMON --startas $STARTAS
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping OScam daemon" "OScam"
start-stop-daemon --stop --quiet --exe $DAEMON
log_end_msg $?
;;
restart)
log_daemon_msg "Restarting OScam daemon" "OScam"
start-stop-daemon --stop --retry 5 --quiet --exe $DAEMON
clear_file
start-stop-daemon --start --quiet --exe $DAEMON --startas $STARTAS
log_end_msg $?
;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
;;
*)
log_action_msg "Usage: /etc/init.d/OScam {start|stop|restart|status}"
exit 2
;;
esac
exit 0


then press ctr+x to exit, then "y" to save on prompt

Then:
Code:

chmod 755 /etc/init.d/oscam


Then:
Code:

update-rc.d oscam defaults


11. On the clients, install CCcam. This is done via the blue panel.

12. Configure CCcam by editing /var/etc/CCcam.cfg:

nano /var/etc/CCcam.cfg

Delete the contents of the file and add a single line:

N: 192.168.0.6 10000 username password 01 02 03 04 05 06 07 08 09 10 11 12 13 14

13. Insert the smartcard into the reader and reboot.

14. Once server is restarted, on webbrowser type"http://your server_ip:8888"


NOTES:

To get info on the various options in the oscam config files and what they mean, look here:

http://streamboard.gmc.to/svn/oscam/...ution/doc/txt/

To remove a dir:
rm -rf build_dir/

To check log:
tail -f /var/log/oscam.log

To see if oscam running:
ps -A | grep oscam

To start oscam:
oscam -b

To stop oscam:
pkill oscam

OR:

/etc/init.d/oscam status
/etc/init.d/oscam start
/etc/init.d/oscam stop
/etc/init.d/oscam restart


To see usb devices and their address:
lsusb -v


To compile a new version of oscam:

/etc/init.d/oscam stop
cp /usr/local/bin/oscam /usr/local/bin/oscam.PREVIOUS
cd /usr/src
rm -rf oscam
svn co http://streamboard.gmc.to/svn/oscam/trunk oscam
cd oscam
mkdir build
cd build
cmake -DWEBIF=1 ..
make install


Recently Updated