Sometimes engineering or support may provide or request files that must be transferred to or from NetWorker system. Some options to copy files to or from the NetWorker system may not be possible under certain issues or configurations. This article is to assist with various options for getting files on or off Linux NetWorker servers including the NetWorker Virtual Edition (NVE) appliance.
Windows 11 and Windows Server 2019 (or later) have command-line SCP functionality. You can SCP a file from a Windows system to a Linux server using:
scp FILE USER@HOSTNAME:/PATH/TO/PUT/FILE
There are also graphical user-interface tools which can be used to SCP files from a Windows system to a Linux system (For example: WinSCP, FileZilla ). These Windows utilities can be installed and use SSH or SCP to connect to the Linux NetWorker server to copy files to/from. This method uses the Linux user permissions of the user account specified when connecting to the Linux system from the SCP agent. This method requires the SSHd service to be running on the NetWorker server.
/etc/ssh/sshd_config
file which fails SSH or SCP connections using the root account with "Access Denied."
If the NetWorker server is not accessible over SSH, you can create a NetWorker client for the NetWorker server, for the save sets specify the files that you need copied off. Perform a backup of the newly created client; then perform an FLR of the files to a different target Linux system where SSH is working. The files can be SCP from the target system or copied from CIFS share to the windows system if configured. This method can also be used to FLR files needed on the NetWorker server by backing them up on a remote Linux client then performing an FLR to the NetWorker server.
Depending on the specific Linux distribution installing NFS may differ. This should only be performed by the end user; this article only provides basic NFS instructions, for additional information see NFS instructions for your Linux OS. NFS allows you to copy files between two Linux systems.
To confirm if NFS is running on the system the files are copied from, run the following command:
rpcinfo -p | grep nfs
The output should show:
100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100227 3 tcp 2049 nfs_acl
If NFS is running, perform the following:
sudo mkdir /mnt/nfsshare
cp
command.sudo chown -R nobody: /mnt/nfsshare
sudo chmod -R 777 /mnt/nfsshare
/etc/exports
file to contain the mountpoints and access information:Syntax: /mnt/nfsshare NETWORK-IP-ADDRESS/NETMASK(rw,sync,no_all_squash,root_squash)
Example:
[root@linuxserver ~]# cat /etc/exports /mnt/nfsshare 192.168.0.0/24(rw,sync,no_all_squash,root_squash)
sudo exportfs -arv
You can display the share with:
sudo exportfs -s
From the NFS client system, confirm you can reach the NFS server over port 2049:
curl -v NFS-SERVER-NAME:2049
[root@linuxserver ~]# curl -v nsr:2049 * Rebuilt URL to: nsr:2049/ * Trying 192.168.0.5... * TCP_NODELAY set * Connected to centos8 (192.168.0.5) port 2049 (#0) ... Removed for brevity
Resolve any firewall connection issues on or between the source/target NFS systems if the connection times out or is refused.
sudo mkdir /tmp/mnt
sudo mount -t nfs NFS-SERVER-IP:/mnt/nfsshare/ /tmp/mnt
ls -l /tmp/mnt
[root@linuxserver ~]# ls -l /tmp/mnt total 0 -rwxrwxrwx 1 nobody nobody 0 May 20 10:13 somefile1 -rwxrwxrwx 1 nobody nobody 0 May 20 10:13 somefile2
cp /tmp/mnt/* .
You can copy the needed files between a Windows system and the Linux NetWorker system if CIFS / SMB is installed on the Linux system. This configuration should only be performed by the end user. This article only provides basic CIFS/SMB instructions; for more detailed instructions see CIFS/SMB instructions for your specific Linux OS. To check if the SMB service is running, you can run:
sudo systemctl status smb
The sudo testparm
command shows you how SMB is configured, for example:
[root@linuxserver ~]# testparm Load smb config files from /etc/samba/smb.conf Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions # Global parameters [global] dns proxy = No map to guest = Bad User security = USER server string = Samba Server %v workgroup = EMCLAB idmap config * : backend = tdb [Share] guest ok = Yes path = /mnt/samba read only = No
The configuration file shown can be modified with sudo vi
(this requires restarting the SMB service). The file should contain the domain name as the workgroup, netbios name of the Linux NetWorker server, and configuration parameters for the shared directory:
[root@linuxserver ~]# cat /etc/samba/smb.conf [global] workgroup = amer server string = Samba Server %v netbios name = linuxserver security = user map to guest = bad user dns proxy = no [Share] path = /mnt/samba browseable = yes writeable = yes guest ok = yes read only = no
If an SMB is running on the NetWorker system, perform the following:
sudo mkdir /mnt/samba
/mnt/samba dir
using the Linux cp
command.sudo chown -R nobody: /mnt/samba
sudo chmod -R 777 /mnt/samba
sudo systemctl restart smb
This uses the netbios name and the [Share] name from the Linux server's /etc/samba/smb.conf
file.
To copy files to the NetWorker server without SSH access, you can create a mountable ISO containing the files needed on the NetWorker server. How the ISO is mounted can vary depending on the server's backend, the following example goes over a VMware VM NetWorker server. This method is "read-only" so it can only be used to copy files to the NetWorker server.
mkdir /tmp/mnt
mount /dev/cdrom /tmp/mnt
cp /mnt/cdrom/* .
You can also use the PowerCLI cmdlet Copy-VMGuestFile
to copy files from a Windows system to a Linux NetWorker system deployed in VMware. This article provides basic instructions for using PowerCLI. See Microsoft documentation on PowerCLI and Copy-VMGuestFile
for additional details.
For instructions on installing PowerCLI, see VMware documentation: https://developer.broadcom.com/powercli/installation-guide
If PowerCLI is installed, perform the following.
Connect-VIserver
PS C:\Users\Administrator> Connect-VIServer cmdlet Connect-VIServer at command pipeline position 1 Supply values for the following parameters: Server[0]: vcenter.amer.lan Server[1]: Name Port User ---- ---- ---- vcenter.amer.lan 443 VSPHERE.LOCAL\bkupadmin
Connect-VIServer
command fails with an SSL error; optionally, this can be ignored:
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
Copy-VMGuestFile
cmdlet to copy the needed file to the Linux NetWorker system:Copy-VMGuestFile -Source PATH-TO-NEEDED-FILE -Destination PATH-ON-TARGET -VM VM_NAME -LocalToGuest -GuestUser TARGET-USER -GuestPassword TARGET-USER-PASSWORD
PS C:\Users\Administrator> Copy-VMGuestFile -Source "C:\Share\somefile1" -Destination "/tmp/somefile1" -VM LINUXVM -LocalToGuest -GuestUser root -GuestPassword 'Pa$$w0rd01' PS C:\Users\Administrator>
[Copy-VMGuestFile], NoPermission
, the VMware user account used in step 1 does not have permissions to do perform this action. Ensure that the user account is assigned a role that includes the VirtualMachine.GuestOperations.Query privilege. This can be done through the vSphere Client.
[root@linuxserver ~]# ls -l /tmp total 0 -rw-r--r--. 1 root root 0 May 20 12:32 somefile1