Это связано с тем, что Vagrant предоставляет IP-адрес интерфейсу eth0, а настройка по умолчанию — через DHCP. Итак, если вы хотите сделать это с некоторыми исправлениями, вот ответ. Все, что вам нужно сделать, это отредактировать файл /etc/network/interfaces с помощью
nano /etc/network/interfaces
и добавить строку post-up resolvconf -d eth0.dhclient
послеiface eth1 inet dhcp
чтобы ваш /etc/network/interfaces
выглядел так
`
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# Source interfaces
# Please check /etc/network/interfaces.d before changing this file
# as interfaces may have been defined in /etc/network/interfaces.d
# NOTE: the primary ethernet device is defined in
# /etc/network/interfaces.d/eth0
# See LP: #1262951
source /etc/network/interfaces.d/*.cfg
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto eth1
iface eth1 inet dhcp
post-up resolvconf -d eth0.dhclient
#VAGRANT-END`
С помощью этого я получил то, что хотел:
find . -type f -mtime +5 -ls | ssh remoteuser@remoteserver "cat >> $dir/new1.txt"