Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, January 24, 2017

How to add a fake dummy null printer in centos 7

Please find the below step by step simple method to add tge fake , dummy or Null printer on Centos7

1. Install the rpm packages for configuration of printer
#yum install system-config-printer*

2. Install cups printer packages
#yum install cups*

3. start the cups services on the centos 7

# systemctl status cups
cups.service - CUPS Printing Service
   Loaded: loaded (/usr/lib/systemd/system/cups.service; enabled; vendor preset: enabled)
   Active: inactive (dead)

# systemctl restart cups

# systemctl status cups
cups.service - CUPS Printing Service
   Loaded: loaded (/usr/lib/systemd/system/cups.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2017-01-23 09:23:11 GMT; 4s ago
 Main PID: 6121 (cupsd)
   CGroup: /system.slice/cups.service
           └─6121 /usr/sbin/cupsd -f

Jan 23 09:23:11 linux systemd[1]: Started CUPS Printing Service.
Jan 23 09:23:11 linux systemd[1]: Starting CUPS Printing Service...

Please add below line in cupsd.conf if doesn't exist.

# vi /etc/cups/cupsd.conf
FileDevice yes

Command to add a printer-

# lpadmin -p myprinter -E -v file:///dev/null

To check the default printer status-

# lpstat -s
no system default destination
device for myprinter: ///dev/null

Friday, January 6, 2017

How to install Samba Server in RHEL 5

In this Post, I will describe how to install samba server in RHEL 5. Samba Server is basically used for file sharing services. 

In this article, We will install the Samba Server using "YUM" utility. All the required packages are installed using YUM.

Step by Step installation method of SAMBA Server:

1. In the first step, we will install the required packages or rpm for SAMBA server creation. As describe already for this I will use YUM utility.
#yum install samba*

Using above command all the required packages has been installed successfully.

2.  Now start the service of samba on the server operating system.

#service smb restart
#chkconfig  smb  on

Once you start the SAMBA service, you must permanent this services otherwise once you take a restart of your machine the service get disabled.

3. In this step , please create a folder which you want to share through samba.

#mkdir /backup

In my case I have created the "/backup" folder for SAMBA sharing.

4. Now, we will provide the full permission to samba folder to everyone have read/write access for this shared folder.

#chmod  -R 777 /backup

Permission for the samba folder depends upon your requirment.

5. In this step, go to the configuration file of samba and edit the below configuration lines which is mandatory during SAMBA server installation.

#vi  /etc/samba/smb.conf

"Changes all below in configuration file
Work group = SAMBA
Server string = This is my samba server
Uncomment  this line  ;netbios name= DNS server
Passwd backend= smb passwd

[backup]
path=/backup
browseable = yes
writable = yes
valid users = vibhor
guest ok = yes
Save the file"

If you see the above entry, the shared samba path is browseable and writeable for only valid user "vibhor". If you want provide access more user then you need to add user name in this entry.

6. Now to check the entry in samba is correct or not which I was made in smb.conf file, please run the below command for verification.

#testparm

7. Now add a user which you want to give a access of samba folder.

#useradd  vibhor
#passwd  vibhor

You can replace the user name according to your client requirement.

8. After final configuration is done , now you need to restart the samba services on the server, So that configuration is made permanent.

#/etc/init.d/smb  restart

8. In the final step, if you want to login on SAMBA server on same operating system you need to use below command for login.

#smbpasswd  -a  vibhor

It is asking the password , once you enter the Samba user password it is login on the server. And if you want to access the samba server from another Linux machine please use the below command/synatx for login.

#smbclient  //192.168.1.12/backup  -U  vibhor
smb>exit

So, using above step by step method you can installed and configured the SAMBA server on Red hat operating system. I would request to you please let me know if you facing any issue while creating the SAMBA server.

Monday, January 2, 2017

Step by step installation method of FTP server in linux

In this post, I will guide to you how to install or create the ftp server in Linux operating system.

Generally FTP server is used to upload or download the files from server machine to client machine. FTP works on TCP 20/21 protocol, TCP port 20 is used for uploading and TCP 21 port is used for downloading purpose.

In this article, I will explain step by step method of ftp server creation and configuration.

Step by step method of FTP server installation and configuration:

1. In the initial step , we will install the all required rpm or packages on the Linux server using "YUM" utility.

#yum  install  vsftpd*

If you have source rpm packages then you can install it. In our case we will install the rpm with yum. Using above command all the ftp packages and their dependency are installed.

2. Once the required packages has been installed successfully on the Linux server, we will start the ftp services on the server.

#service  vsftpd  start

Once the service start successfully we will make permanent it so after reboot of server it would be enable always.

#chkconfig vsftpd on

3. Now, to check the location of ftp server file which we upload or create after ftp server installation.

#cd /var/ftp/pub
#ls

And check the file which you have created after ftp server installation. If you find your created file here then you can ensure your ftp server has been installed successfully on Linux server.

4. Now for checking the ftp server using login in it.

# ftp  Server IP address  ( In my case server ip is 192.168.1.240)
Name(192.168.1.240:root):anonymous
Passwd   (press enter)   --- by defult anonymous password is blank

ftp>   (It will show you have successfully enter in ftp server)
ftp> ls
pub ( will see this directory in ftp location)
ftp>cd  pub
pub> mkdir  vibhor
pub> permission denied  (error getting)

5. To give the permission to make a directory in pub ,changes in this file

#vi  /etc/vsftpd/vsftpd.conf

Uncomment all these below lines
anonymous_enable=yes
anon_upload_enable=yes
anon_mkdir_write_enable=yes
save the file

6. Now we will take a restart of the ftp services again. You can follow the step 2 to take a restart of ftp services.

7. In this step we will provide the permission to pub folder so that client user can read/write the file and folder in the default direcoty.

#chmod 777  /var/ftp/pub

In my case I will give the full permission to pub folder. You can set the permission according to your project requirement.

8. If you want to ensure that you are able to created and access the folder or not on ftp server then in this case you need to login again in ftp server.

#ftp  192.168.1.240
Name: anonymous
Passwd (enter)
ftp> Cd  pub
pub>mkdir vibhor
vibhor           (directory created)
pub>ls
vibhor

If you want to check the directory which we created in above text please go to the below location and find it

#cd  /var/ftp/pub
Pub]#ls
Vibhor

So now you will get the file on the ftp pub folder which you created that means the permission which you provide to the user are working properly.

9. You want only one user is able to login by ftp server and access only one particular folder, also not able to delete the file and folder on ftp server, having a ability of uploading and downloading through ftp server. For this thing we have to change in configuration file and chroot_list, ftpuser file.

First create a user which you want to access for ftp user
# useradd  -s /sbin/nologin  ttftpuser       (His shell is nologin so other user not login)
#passwd  ttftpuser

Now create a folder in ttftpuser which you want to give access

#cd  /home/ttftpuser
ttftpuser~]#mkdir  noidaftp
ttftpuser~]#chmod  777  noidaftp

Now go to the file chroot_list, add the user  only which you want to give access.

#vi  /etc/vsftpd/chroot_list
ttftpuser    (make a entry of user which you want to give access)

Now if you want no other user login in ftp server then entry all those user except chroot_list user in ftpuser file.

#vi /etc/vsftpd/ftpuser

Promartuser    (these are users on which ftp server is make )
Vibhor

Now go to configuration file and make changes in  file and change all the parameter which is required on the configuration files.

#vi /etc/vsftpd/vsftpd.conf

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
syslog_enable=NO
dual_log_enable=YES
vsftpd_log_file=/var/log/vsftpd.log
xferlog_file=/var/log/xferlog
xferlog_std_format=YES
ftpd_banner=*************************Welcome to blah FTP service******************
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
listen_port=54321
cmds_allowed=ABOR,ACCT,ALLO,APPE,CDUP,CWD,EPRT,EPSV,FEAT,HELP,LIST,MDTM,MKD,MODE,NLST,NOOP,OPTS,PASS,PASV,PORT,PWD,QUIT,REIN,REST,RETR,RMD,RNFR,RNTO,SITE,SIZE,SMNT,STAT,STOR,STOU,STRU,SYST,TYPE,USER,XCUP,XCWD,XMKD

Save the file for above changes which is in bold text in file and restart the ftp services which is describe in step 2.

#service vsftpd restart

Now check login on console mode

#ftp  192.168.1.243 54321

Enter username:ttftpuser
Passwd..enter the passwd
ftp> you have successfully enter
ftp>ls
noidaftp      (folder you have seen)
ftp>put  vsftpd.conf        (it will upload file )
ftp>get  vsftpd.org          (it will download file)

If you want to change the user shell please run the below command method as describe below.

#usermod  -s  /sbin/nologin  username
#usermod  -s /bin/bash  username

So using above method we can easily installed and configured the ftp server on Linux operating system.

Wednesday, December 28, 2016

Step by step method to configure static IP address in Solaris10


Please find the step by step method to provide the static ip address on Solaris 10 operating system.

Step 1: Please run the below command to delete the old ip address. In my machine the "net1" Ethernet card is configured already.

sun> ipadm delete-ip net1

Step 2: To check the current status of all Ethernet card attached with machine as per below command.

sun> ipadm show-if -o all
IFNAME     CLASS    STATE    ACTIVE CURRENT       PERSISTENT OVER
lo0        loopback ok       yes    -m46-v------  46--       --
net0       ip       ok       yes    bm46--------  46--       --
sppp0      ip       ok       yes    -m4-p-------  ----       --

Step 3: Please create your new Ethernet card as per below command.

sun> ipadm create-ip net1

sun> ipadm show-if -o all
IFNAME     CLASS    STATE    ACTIVE CURRENT       PERSISTENT OVER
lo0        loopback ok       yes    -m46-v------  46--       --
net0       ip       ok       yes    bm46--------  46--       --
net1       ip       down     no     bm46--------  46--       --
sppp0      ip       ok       yes    -m4-p-------  ----       --

Step 4: To provide the static IP address please run the below command. Please change your IP address with highlighted address.

sun> ipadm create-addr -T static -a 172.26.7.29/16 net1/v4

In case of any issue please comment on the blog.