cat /etc/network/interfaces
For Client:
cat /etc/hostname
# > iavclient
cat /etc/hosts
# > 127.0.0.1 localhost
# > 127.0.1.1 ru01std00v
ping iavserver
# 64 buytes from iavserver (192.168.122.230): icmp_seq=1 ttl=64 time=4.33 ms
# ...
For Server:
cat /etc/hostname
# > iavserver
cat /etc/hosts
# > 127.0.0.1 localhost
# > 127.0.1.1 ru01std00v
ping iavclient
# 64 buytes from iavclient (192.168.122.235): icmp_seq=1 ttl=64 time=3.97 ms
# ...
Machine name | Server | Client |
---|---|---|
Host name | iavserver | iavclient |
IP address | 192.168.122.12 | 192.168.122.13 |
Default gateway | 192.168.122.1 | 192.168.122.1 |
Client's eth0 interface configuration
sudo nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.122.12
netmask 255.255.255.0
gateway 192.168.122.1
Adding server's domain
sudo nano /etc/hosts
# local domain
127.0.1.1 iavclient
# server domain
192.168.122.13 iavserver
sudo systemctl restart networking
ping iavserver
# 64 buytes from iavserver (192.168.122.13): icmp_seq=1 ttl=64 time=4.33 ms
Server's eth0 interface configuration
sudo nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.122.13
netmask 255.255.255.0
gateway 192.168.122.1
Adding client's domain
sudo nano /etc/hosts
127.0.1.1 iavserver
# client domain
192.168.122.12 iavclient
sudo systemctl restart networking
ping iavclient
# 64 buytes from iavclient (192.168.122.12): icmp_seq=1 ttl=64 time=1.07 ms
Server's side config:
# install ftp daemon
sudo apt install vsftpd
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
# open config file
sudo nano /etc/vsftpd.conf
Should be next params:
listen=YES
listen_ipv6=NO
anonymous_enable=YES
local_enable=YES
write_enable=YES
sudo systemctl restart vsftpd
echo "test file" > ~/ftp/iav.txt
sudo usermod -d /home/astra/ftp/ ftp
wget ftp://[email protected]/iav.txt
Server:
sudo apt install samba
sudo mkdir /srv/share
sudo chown 777 /srv/share
sudo nano /etc/samba/smb.conf
sudo systemctl restart smbd
map to guest = bad user
[share]
comment = hello_everyone
guest ok = yes
force user = nobody
force group = nogroup
path = /srv/share
read only = no
Client:
sudo apt install cifs-utils
sudo mkdir ~/mnt
sudo mount -t cifs //192.168.122.13/share /home/adminstd/mnt -o users,sec=none
ls ~/mnt
# > iav.txt
2.4. Change date and time on client to 01.01.1970 18:12. Sync date and time with Server's date and time using NTP-server
# Client's machine
sudo apt install ntp
sudo cp /etc/ntp.conf /etc/ntp.conf.orig
sudo rm /etc/ntp.conf
sudo nano /etc/ntp.conf
server 192.128.122.13 prefer
sudo systemctl restart ntp
sudo systemctl status ntp
sudo apt install ssh
sudo systemctl start sshd
sudo systemctl enable sshd
sudo systemctl status sshd
ssh key-gen
ssh-copy-id [email protected]
echo "Hello, world!" > /home/study/hello.txt
# scp user@server_ip:path local_path
scp [email protected]:/home/study/hello.txt /hello_received.txt