Unix/Linux Networking File transfer commands: ftp

advertisement
Unix/Linux Networking
File transfer commands:
ftp
rcp
nfs
mail
uucp
Remote Login commands: (not secure!)
telnet
rlogin
rexec
Remote access commands:
rsh
remsh
nfs
web
ping
ftp commands:
ftp hostname
-orftp
open
?
help
? command
open
user
dir ls
cd lcd
mkdir
pwd
prompt
get mget
put mput (send)
del
quit close
Considerations:
anonymous ftp, localroot
restrictions
/etc/chroot
/etc/ftpusers
( root / tty's )
/etc/securettys
The standard networking protocol used by Unix/Linux is TCP/IP
Two methods for resolving hostnames;
/etc/hosts :
DNS
:
See:
each machine has its own list of hosts and addresses
Host database kept on centralized servers
/etc/resolv.conf
Some useful commands:
ping
nslookup
(works with DNS)
traceroute
ifconfig
hostname
Some important network configuration files:
/etc/rc.d/init.d/nfs
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
(Linux)
(Linux)
(Linux)
Network file systems. (NFS)
Similar to directory shares Windows
Basic difference with Windows is;
Windows uses drive letters,
Unix/Linux use mount point
To implement NFS requires a NFS Server and an NFS Client.
Unix/Linux computers (like Windows computers) can act as both
Simultaneously.
Configure the server side:
1. Login to the host machine as root
2. Edit /etc/exports
e.g.
/home/mike -anon=65534,root=term1:term2:linux1
In the above example of the file /etc/exports, unknown users are
assigned the user id 65534. The computers term1, term2 and linux1
are granted root user privileges.
3.
Activate the exported file by executing the exportfs command.
exportfs /home/mike
The directory /home/mike on the host computer is now "shared" so that
any computer on the network with the proper NFS client software running
can mount /home/mike on their local file system.
Configure the client side
1. Login the computer mpharris as root
2. Create the appropriate directory if it doesn't already exist.
e.g.
mkdir /mnt/nfs-home
3. Check that your computer can resolve the IP-Address for the host.
e.g.
ping mpharrris.DynDns.org
You can mount the file system interactively so that when you reboot,
the mount no longer exists, or you can configure so that the NSF file
system is always available whenever the system is booted.
4. To mount interactively:
mount mpharris:/home/mike /mnt/nfs-home
5. To setup for automatic mount:
vi /etc/fstab
Add the line;
mpharris:/home/mike /mnt/nfs-home nfs
6. Execute the mount command.
mount /mnt/hp-home
defaults,nolock,rsize=4096,wsize=4096 0 2
To unmount the file system:
umount /mnt/nfs-home
Exporting a Linux file system:
1. Login as root
2. Edit the exports file
vi /etc/exports
e.g.
/usr/local mpharris(rw,no_root_squash)
3. Stop the NFS server.
/etc/rc.d/init.d/nfs stop
4. Restart the NFS server.
/etc/rc.d/init.d/nfs start
For more information:
man exports
man exportfs
man mount
man nfs
man fstab
man fuser
Example file: /etc/exports
/
/projects
/usr
/home/joe
/pub
(Linux)
master(rw) trusty(rw,no_root_squash)
proj*.local.domain(rw)
*.local.domain(ro) @trusted(rw)
pc001(rw,all_squash,anonuid=150,anongid=100)
(ro,insecure,all_squash
Download