- virtualbox
- vagrant
- centos/7
$ sudo mkdir /etc/vbox/
$ sudo touch /etc/vbox/networks.conf
/etc/vbox/networks.conf
+ * 192.168.0.0/24
/etc/hosts
+ 192.168.0.18 h2g.example.com h2g
$ mkdir -p ~/Boxes/xxx && cd $_
$ vagrant init centos/7
$ vagrant up
$ vagrant halt
Vagrantfile
- # config.vm.network "private_network", ip: "192.168.33.10"
+ config.vm.network "private_network", ip: "192.168.0.18"
- # config.vm.provider "virtualbox" do |vb|
+ config.vm.provider "virtualbox" do |vb|
- # vb.memory = "1024"
+ vb.memory = "2048"
- # end
+ end
確認
$ vagrant up
$ ping h2g.example.com
$ ^C
p28
server$ sudo yum install ftp **vsftpd**
server$ sudo yum install httpd
server$ sudo yum install samba-client
server$ sudo yum install **mailx** sendmail-cf sendmail
server$ sudo yum install telnet telnet-server
server$ sudo yum install xinetd
server$ sudo yum install uw-imap libc-client
- /etc/xinetd.d/ipop3
- /etc/mail/sendmail.cf
- /etc/vsftpd/vsftpd.conf
- /etc/selinux/config
- /etc/hosts
p27
server$ sudo set enforce 0
server$ sudo systemctl disable firewalld
server$ sudo systemctl disable NetworkManager
server$ sudo systemctl enable telnet.socket
server$ sudo systemctl enable xineted
server$ sudo systemctl enable httpd.service
server$ sudo systemctl enable sendmail.service
- systemctl status ${Unit}
- systemctl start ${Unit}
- systemctl stop ${Unit}
- systemctl enable ${Unit}
- systemctl disable ${Unit}
- systemctl is-enabled ${Unit}
- systemctl list-unit-files --type=service
server$ ss -at | grep 'LISTEN'
ftpd
$ ftp localhost
>> Name: vagrant
>> Password: vagrant
>> exit
telnet
server$ telnet localhost
>> login:vagrant
>> Password:vagrant
>> exit
http
server$ curl localhost
smtp
server$ mail vagrant@localhost
>> Subject:test
>> Test message
>> .
>> EOT
pop3
server$ mail
>> & 1
>> & quit
telnet
client$ nc -t h2g.example.com 23
>> login: vagrant
>> Password: vagrant
>> exit
$ ^C
http
client$ telnet h2g.example.com 80
>> HEAD / HTTP/1.0
smtp
client$ telnet h2g.example.com 25
>> EHLO example.com
>> MAIL FROM: <MailAddress>
>> RCPT TO:<[email protected]>
>> DATA
>> message
>> .
>> quit
pop
client$ telnet h2g.example.com 110
>> user vagrant
>> pass vagrant
>> stat
>> list
>> retr 1
>> quit