I need to copy several Tbs of data FROM a Windows computer TO a Linux computer. I can do this in two commands in Command Prompt

Copy only directories and files that are not jpeg or jpg
robocopy dir_source dir_target /S /XF *.jpeg *.jpg

Copy securely these to the linux server which is password protected
scp -r dir_target linuxserver:/dir/path

Problem. The exclude flag of scp cannot be used in Windows. The first step seems redundant and slows the process. Could this be done in one step?

NB! I cannot copy the files with scp from the Linux server due to network configurations. In addition, the Linux server is used by multiple users but I have a private directory where others do not have access. However, I have sudo privileges only to the Windows computer, not to the Linux server.

1 Answer 1


What about samba which is the linux compatible with windows file sharing.

Then you can mount the drive in windows, and use robocopy.

In the config file smb.conf

smb encrypt = mandatory in the [global] section

[Some Other Share]
    path = /path/to/some/other/share
    guest ok = no
    writeable = no
    write list = @group
    valid users = @group
  • Thanks for the very nice suggestion. Two questions. 1. The Linux computer is actually a computing instance for many users. Other users should not access to the samba share if I configure it to my home directory, but does this pose any security threats? 2. I do not have sudo privileges in the Linux computer, is this is problem?
    – obruzzi
    Commented Sep 14, 2023 at 18:12
  • All the shares are controlled in the smb.conf file. You can delete the whole {home] section of the config. You provide a read and a write list of users in the config file. smbpasswd -a username create a samba users and then it prompts you for a password. I am not sure it you need sudo or not.
    – cybernard
    Commented Sep 14, 2023 at 18:22
  • You can also connect Linux to Windows with a simple file mapping because Windows supports SMB. I use this myself and this may help you.
    – anon
    Commented Sep 14, 2023 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .