Pages

Showing posts with label FTP. Show all posts
Showing posts with label FTP. Show all posts

Thursday, March 3, 2016

Multiple FTP User for same home directory in VSFTP


*** Two FTP User Tayab and Khan will share same home directory to upload and download /var/www/html/career

cd /var/www/html
adduser tayab -d /var/www/html/career/
chown -R tayab:tayab careerbd
passwd tayab
adduser khan -d /var/www/html/career/ -g tayab
passwd khan
chmod g=rwx -R *
***
vi /etc/vsftpd/user_list
tayab
khan
------------
CentOS VSFTPD File
==================
root# cat /etc/vsftpd/vsftpd.conf
# ============================
#local_umask=07
anonymous_enable=NO
chroot_local_user=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
ftpd_banner=Welcome to Jobsbd's FTP service- by Tayab Khan.
listen=YES
pasv_min_port=2121
pasv_max_port=2142
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
userlist_deny=NO
syslog_enable=YES
xferlog_enable=NO
vsftpd_log_file=/var/log/vsftpd.log
xferlog_std_format=NO
log_ftp_protocol=YES
# =================================

Ubuntu VSFPTD FILE...
===============
root@www:~# grep "^[^#;]" /etc/vsftpd.conf
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
pasv_enable=Yes
pasv_min_port=40000
pasv_max_port=40100
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=ftp
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
allow_writeable_chroot=YES
----------------------
vi  /etc/vsftpd.user_list
tayab
khan
=================

login via coreftp

Sunday, August 2, 2015

Saturday, January 3, 2015

Media / FTP / File server in Linux


### Install a HTTP server
give appropriate permissions of directory documentroot
and create an HTML page like bellow


=========================
<!DOCTYPE html>
<html lang="en">
<head>
<title>XYZ Ltd. Media Server</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="css/layout.css" type="text/css" media="all">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery-1.4.2.js" ></script>
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/cufon-replace.js"></script>
<script type="text/javascript" src="js/Myriad_Pro_400.font.js"></script>
<script type="text/javascript" src="js/Myriad_Pro_700.font.js"></script>
<script type="text/javascript" src="js/Myriad_Pro_600.font.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="js/ie6_script_other.js"></script>
<script type="text/javascript" src="js/html5.js"></script>
<![endif]-->
</head>
<body id="page1">
<!-- START PAGE SOURCE -->
<div class="main">
<header>
<img src="images/abc-me.gif" alt="Daffodil Online Ltd. Media Server" style="width:914px;height:78px">
<a "images/flash.swf" >
</header>
<section id="content">
<div class="wrapper">
<div class="wrapper">
<ul class="banners">
<li> <a href="../movie/"><img src="images/page1_img1.jpg" alt=""></a>
<div class="pad">
<a href="../movie/"> <p class="font1">Movies</p></a>
<p>Click here for all types of Movies (Hollywood, Bollywood, Dhaliwood) </p>
</div>
</li>
<li> <a href="../natok/"><img src="images/page1_img2.jpg" alt=""></a>
<div class="pad">
<a href="../natok/" <p class="font1">Natoks</p> </a>
<p>Click here for Bangla Natoks</p>
</div>
</li>
<li> <a href="../os/"><img src="images/page1_img3.jpg" alt=""></a>
<div class="pad">
<a href="../os/"> <p class="font1">Softwares</p> </a>
<p>Click here for Operating system and Other Softwares</p>
</div>
</li>
<li> <a href="../song/"><img src="images/page1_img4.jpg" alt=""></a>
<div class="pad">
<a href="../song/"> <p class="font1">Songs</p> </a>
<p> Click here for Bangla, English and Hindi Songs</p>
</div>
</li>
</ul>
</div>
<div class="wrapper">
<div class="box bot pad_bot2">
<div class="pad">
<article class="col1">
<h2>About Daffodil Online Ltd.</h2>
<strong>Daffodil Online Ltd.</strong> iprides itself as one of the leading ISP Service Provider in Bangladesh.
We are the most experienced and oldest company in the ICT field where our basic business ethics is Long Term Relationship with our customers.
<div class="wrapper">
<figure class="left marg_right1 marg_top2"><img src="images/page1_img5.jpg" alt=""></figure>
<p class="marg_top">As we look at the growth over the decade since our inception,
we are extremely proud of what we have achieved, and even more excited about our outlook for an equally promising future.</p>
</div>
<p>It may please you to know that we started our operation in the year 2002.
During the past years, we extended our operation and service portfolio according to the customer’s recommendation and
considering demands of time. We worked with many national projects and international organizations and achieved the reputation.
We are using the latest technologies and upgrading the services wherever it is required.
Our Corporate Network Solution department is capable to provide state-of-art network and telecommunication solutions
with a highly efficient technical expertise group.
</article>
<article class="col2 pad_left1">
<h2>Live Radio</h2>
<div class="wrapper">
<div class="wrapper pad_bot1">
<figure class="left marg_right1"><a href="#"><img src="images/fmradio0028.gif" alt=""></a></figure><p>বাংলা অনলাইন রেডিও</p>
<script type='text/javascript'>
var site_id = 1;
var radio_width = 235;
var radio_height = 155;
</script>
<script type='text/javascript' src='http://radio.amarputhia.com/free/script.js'></script>
<div class="wrapper pad_bot1">
<p>Music For Every Moment</p>
</div>
</article>
</div>
</div>
</div>
</div>
</section>
<footer>
<p class="lf">Copyright &copy; 2014 <a href="#">Daffodil Online Ltd.</a> - All Rights Reserved</p>
<p class="rf"><a href="http://serverip/">Designed</a> by <a href="http://serverip">Tayab Khan</a></p>
<div style="clear:both;"></div>
</footer>
</div>
<script type="text/javascript"> Cufon.now(); </script>
<!-- END PAGE SOURCE -->
</body>
</html>

====================================================

Monday, November 17, 2014

Linux FTP Multiple users directory change and permission set and FTP server




Linux FTP multiple users directory change and permission set
=====================================================

Let we a vsftp sever in CentOS.
A user khan created and need to change ftp login path to /home/FTP-Uploads/


adduser khan
passwd khan

usermod -g root khan
chmod g=rw -R /home/FTP-Uploads/
chown -R khan /home/FTP-Uploads/

vi   /etc/passwd

khan:x:511:0::/home/FTP-Uploads/:/sbin/nologin

## Adding another user name "tayab" and give him to "FTP-Uploads" directory permission
## Multiple user in permission for one Directory
Multiples users should be in same group ..
Here I add both user "khan" and "tayab" to root group
by
usermod -g root tayab
vi /etc/group
root:x:0:khan,shakkhor


setfacl -m u:tayab:rwx -R FTP_Uploads

===============================

Sample FTP Server  
==================
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
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
ftpd_banner=Welcome to Tayab-Khan's FTP service.
listen=YES
pasv_min_port=2121
pasv_max_port=2142
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
======================
IPtables for FTP::
-A INPUT -p tcp -m state --state NEW -m tcp -m multiport --dports 2121:2142 -j ACCEPT
-A INPUT -s 10.10.10.0/24 -p tcp -m state --state NEW -m tcp --dport 20 -j ACCEPT
-A INPUT -s 10.10.10.0/24 -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
================================

Some Commands 
----------------------------
to find without hashed lines   root#   egrep -v '^(#|$)'  /etc/vsftpd/vsftpd.conf 
or                                            root#   grep -E -v '^(#|$)'  /etc/vsftpd/vsftpd.conf

to find and send outputs to another file..
 root#  sed -e '/^[ ]*#/d' -e '/^[ ]*;/d' -e '/^$/d' //etc/vsftpd/vsftpd.conf > /root/tayab-ftp-active-lines.txt

=======================================================

File and Directory permission issues
--------------------------------------------
To change all the directories to 755 (drwxr-xr-x):

find /home/tayab/lampp/htdocs -type d -exec chmod 755 {} \;

To change all the files to 644 (-rw-r--r--):

find /home/tayab/lampp/htdocs -type f -exec chmod 644 {} \;

-----------------------------------------------------------------



Thursday, January 16, 2014

Juniper Router Backup to ftp server command



set system archival configuration transfer-on-commit archive-sites "ftp://username:password@203.190.10.174"




system {
    archival {
        configuration {
            transfer-on-commit;
                archive-sites {
                    "ftp://admin:password@203.190.10.174";
                }
        }
    }
}