Server Building Chapter

Source: Internet
Author: User
Tags ssh server

The following servers are built under Ubuntu:

==================tftp Server Chapter ======================

TFTP server
1. Installation: sudo apt-get install tftpd tftp xinetd
2, modify the configuration file: sudo vim/etc/xinetd.d/tftp, write the following to the configuration file
Service TFTP
{
Socket_type = Dgram
protocol = UDP
wait = yes
user = root
Server =/usr/sbin/in.tftpd
Server_args =-s/tftpboot
Disable = no
Per_source = One
CPS = 2
flags = IPv4
}
3. Create the TFTP server root directory: sudo mkdir/tftpboot
4. Modify the permissions of the server root directory: sudo chmod 777/tftpboot/
5. Restart the server: sudo/etc/init.d/xinetd restart

Or

Apt-get Install TFTPD-HPA tftp-hpa xinetd
The TFTPD-HPA configuration file is/etc/default/tftpd-hpa
Tftp_username= "TFTP"
tftp_directory= "/tftpboot"
Tftp_address= "0.0.0.0:69"
Tftp_options= "-l-c-S"

sudo mkdir/tftpboot
chmod 777 Tftpboot-r

/etc/init.d/xinetd restart

Service TFTPD-HPA Restart

TFTP client:
First, download
1, first login: TFTP TFTP server IP address, for example: TFTP 127.0.0.1
2. Download using get command: Get file name for example: Get test.c
3. Exit: quit/q

Second, upload
1, first login: TFTP TFTP server IP address, for example: TFTP 127.0.0.1
2, re-upload: Put file name,,, for example: Put TEST.c (due to permission reasons to perform a problem)
Workaround:
1. Create the file with the same name as the file you want to upload in the TFTP server root directory: touch/tftpboot/test.c
2. Add additional Write permissions to other users of the new file: sudo chmod o+w/tftpboot/test.c
3, re-login: TFTP TFTP server IP address
4, re-upload: Put file name,,, example: Put test.c
5. Quit; quit


XP as a client:
The first thing to do is to ensure that the network is:
1. Login: TFTP 192.168.1.111 get file name,,,, for example:
TFTP 192.168.1.111 get test.c

Note turn off both sides of the firewall sudo service UFW stop


==================================nfs Server Chapter =========================================
1. Installing NFS server-side and client software
Installation Server: sudo apt-get install Portmap nfs-kernel-server
2. Configure Server for NFS: Modify/etc/exports
1), open/etc/exports file: sudo vim/etc/exports add/home/nfs * (SYNC,RW) to the document
2), create a shared directory: sudo mkdir/home/nfs
Then copy any of the files into the/home/nfs directory for easy Testing
3. Start the NFS service:
1), must first start Portmap:sudo service Portmap start
2), restart Nfs:sudo service nfs-kernel-server start


Clients must ensure that the client and server-side network are connected to each other before accessing the NFS server, and can ping the


Install client: sudo apt-get install Nfs-common
Client:
1. Querying Services for NFS: SHOWMOUNT-E NFS Server IP address
2. Create a target directory to mount to: sudo mkdir/mnt/nfs
3. Mount the shared directory of the NFS server to this machine: sudo mount-t NFS 192.168.1.111:/home/nfs//mnt/nfs
4. View the contents of the/mnt/nfs directory: Ls/mnt/nfs
5. Uninstall: sudo umount/mnt/nfs

Cat/proc/mounts will see mount information;

Firewall to shut down Oh sudo service UFW stop

========================samba Server Chapter ============================
XP as client: Linux as server side
First, install the Samba server
1. Install with command: sudo apt-get install samba
2. Configure the Samba server: sudo vim/etc/samba/smb.conf
[Global]
workgroup = MyGroup
Server string = Samba Server
log file =/var/log/samba/%m.log
max log size =
Security = User
[Homes]
comment = Home directories
browseable = no
writable = yes
[public]
Path =/home/public
Public = yes
Only guest = yes
writable = yes

3. Add Samba Users:
1), add Linux system users: sudo adduser sambauser
2), register the system user as a Samba service user:
sudo smbpasswd-a sambauser
#Added User Sambauser
sudo smbpasswd-e sambauser
#Enabled User Sambauser
4. Set up a shared directory:
1), create the shared directory you want to share: sudo mkdir/home/public

5. Start the Samba server
sudo service smbd start
Service SMBD Restart

To ensure that Windows systems are connected to the Linux system network, ping

Second, client login:
1, enter the operation in Win7: input command: \\192.168.171.129

User name: Sambauser
Password: ********


Linux as a client, XP server-side
Server-side:
1. Device sharing directory in XP system:

Client:
1. Create the target directory for the Mount:
sudo mkdir/mnt/win
2, mount the target directory;
sudo mount-o username=administrator//192.168.1.140/12/mnt/win/
3. View: Ls/mnt/win

View server Status Service SMBD status
Smbstatus


Linux:smbclient-l//localhost/sambauser
Windows: \\linux ip\\sharename

=============================ssh Server Chapter ==================================

Installation: Apt-get Install Openssh-server

Start:/etc/init.d/sshd start

Or: Service sshd restart

To see if SSH is started: netstat-a | grep ssh

Server Building Chapter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.