then use sudo mkdir /home/vsftpd and cd /home/vsftpd
then use sudo mkdir down upload wsn
after that setup the virtual user database
use sudo vi /home/loguser.txt
and the content is
down
password1
upload
password2
wsn
password3
use sudo apt-get install db4.7-util
Then create a new dir and put the configuration in it.
use sudo mkdir /etc/vsftpd
use sudo db4.7_load -T -t hash -f /home/loguser.txt /etc/vsftpd/vsftpd_login.db
set the access of the databases file eventually
use sudo chmod 600 /etc/vsftpd/vsftpd_login.db
configure the PAM file /etc/pam.d/vsftpd.vu
use sudo vi /etc/pam.d/vsftpd.vu with the content
auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd_login
PAM is used to verify the virtual user
and this is activated by the command pam_service_name
Setup the local user for the virtual user
setup a system user called vsftpd and the home dir is /home/vsftpd and the user login terminal set to /bin/false
sudo useradd virtual -d /home/vsftpd -s /bin/false
sudp chown virtual:virtual /home/vsftpd
and until now the three users can work now
6.mail server
mail is used to communicate on the internet
component
MUA
Mail User Agent
used to help the user to send and get the email
MTA
Mail Transfer Agent
used to monitor and send the email
mail protocol
SMTP
simple mail transfer protocol
use port 25
is a request/respond protocol
and be used to setup the SMTP connection between with the remote server
can transfer the mail from client to server
or server to server
POP3
Post office protocol
use TCP 110 port
used to receive the mail
e.g
the client connect with the POP3 server using TCP connection
and the POP3 protocol will affirm the usernamd and userpassword
after that the client can receive or delete the mail
IMAP
Internet Message Access Protocol
can be used as POP3 to receive the mail
can be read offline
can preview the mail
Web Mail
is not a protocol but a plugin
use the browser to receive, send and read the mail
7.APT——-software package managemnt
use /etc/apt/sources.list to store the software package list
which is called the repository
this is widely used in the Debain linux like ubuntu
if the client want to update the software
They will download the dependency file of the softeware and compare with the system file, download all the needed dependencies.
some useful command
12345
apt-get : used to manage the software
apt-cache : used to check the info of the software
apt-proxy : use to construct the proxy server of APT
apt-show-versions : used to show the version of the software in the system
apt-config : use the read the apt coniguration info
8.linux user and process management
user management
linux have three kinds of users
root
ordinary
virtual
like bin, damon, ftp, adm
each used have a UID(user id)
/etc/passwd
used to store the infomation of the users
/etc/shadow
used to store the info that passwd file can not store
like some info about the password
and it is similar with the /etc/group and /etc/gshadow
use the command to manage
whoami
see the name of the current login user
who
check the current login user
w
check the detail info the current login user
id
check the UID, GID and so on infomation of particular user
finger
use to see the infomation of particular user
su
change the login user
write
send message to the particular user
wall
broadcast the infomation to all user
sudo -s
get the root access
useradd / adduser
add user
passwd
change the password of a user
chsh
change the shell the user is using
usermod
change the info of the user account
userdel
delete the user
startx
start the xwindows(GUI)
process management
some useful command
ps
see what process is running
e.g ps aux | more
ps aux | grep httpd
| more
to see the long content in several pages
kill
kill the process
or killall
kill -9 to kill the zombie process
pkill name to kill the process that know its name
top
to see the process dynamically
&
let the command work in the background
e.g make install &
Ctrl + Z
put the process in the background and pause it
jobs
to see what process is in the background
fg
get the background process back
bg
run the backgrounf process in the background
9.linux filesystem
In the linux filesystem, the file system use inode to store the attibute of the file system.
if the file pointed by the inode is opened, then the inode += 1
else if the file is close, then the inode –= 1
linux Ext3 filesystem
develop the log system depend on the Ext2 system
linux Swap system
used for the exchange area
and are used for the memory page to swap the space
and not easy to generate the fragment
10.linux compress
command
compress
gzip and zcat
bzip2 and bzcat and bunzip2
tar
11.linux file link
Symbolic link
soft link
use ln
if the file that is being linked is deleted
than the linked file can not be used.
12.linux disk
useful command
fdisk
df
check the information of the disk
fsck
mount
mount the dir in order to use the disk
13.linux samba
a protocol used to communitcate Unix to Windows
sometimes used to share the file and printer
SMB protocol is running on the top of the NetBios
Samba server is made of
NetBios –> NMB
SMB
14.linux NFS server
NFS is a protocol that used to share the TCP/IP network file with the other.
This can share the file between different kinds of the operating system
NFS can make the usage of the disk higher
And the user do not need to set a home dir one their computer
and set the home dir on the remote server
use dynamic port distribute
because the NFS service may use lots of ports
RPC service mainly used to record the function of the port of the NFS
and RPC service is used in the port 111
when the NFS start, it will select the port that is smaller than 1024