07 July 2011

Linux ftp server

1.find
find -name vsftp*
./vsftpd-2.0.5-16.el5_5.1.x86_64.rpm

2. install
# rpm -Uvh vsftpd-2.0.5-16.el5_5.1.x86_64.rpm

3. configure
Default port: TCP / UDP - 21 and 20
The main configuration file: /etc/vsftpd/vsftpd.conf
Users that are not allowed to login via ftp: /etc/vsftpd/ftpusers
-------------------------------------
Open the configuration file, type:
# vi /etc/vsftpd/vsftpd.conf
Turn off standard ftpd xferlog log format:
xferlog_std_format=NO
Turn on verbose vsftpd log format. The default vsftpd log file is /var/log/vsftpd.log:
log_ftp_protocol=YES
Above to directives will enable logging of all FTP transactions. Lock down users to their home directories:
chroot_local_user=YES
Create warning banners for all FTP users:
banner_file=/etc/vsftpd/issue
Create /etc/vsftpd/issue file with a message compliant with the local site policy or a legal disclaimer
-------------------------------------

4. start and stop
Turn on vsftpd on boot:
# chkconfig vsftpd on

/sbin/service vsftpd start
/sbin/service vsftpd stop

Linux remote desktop

1. find
[]$ find .-name vnc*
vnc-4.1.2-14.el5_5.4.x86_64.rpm

vnc-server-4.1.2-14.el5_5.4.x86_64.rpm

2. install
[]$ rpm -Uvh vnc-server-4.1.2-14.el5_5.4.x86_64.rpm
 
3. configure
edit /home/.vnc/xstartup
----- example for gnome ------------------------------
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
startx
----------------------------------------------------------------
edit
/etc/sysconfig/vncservers
-------------------------------------------------------------
# The VNCSERVERS variable is a list of display:user pairs.

#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
VNCSERVERS="1:oracle"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERARGS[2]="-geometry 1024x768 -depth 32"
-------------------------------------------------------------

4. start
vncserver
-- set password when start first time
-- or set passwd running
vncpasswd

5. start and stop
/sbin/service vncserver start

/sbin/service vncserver stop

6. use via http
in browser
http://server_name:port  (http://192.168.1.1:5801)

7. use on remote pc (linux)
export DISPLAY=1:
vncviewer server_name:port (192.168.1.1:5901)