Results 1 to 8 of 8

Thread: SCP command

  1. #1
    Join Date
    Apr 2013
    Beans
    15

    Lightbulb SCP command

    The content of my script is:

    cp -b /home/ionadmin/my_script5.sh \\192.168.0.174\pgm
    cp -b /home/ionadmin/my_script5.sh \\192.168.0.174\proton


    echo
    echo "Done!"
    date
    echo

    I've done the following 3 tests :

    Test1
    I first copied a local file from the Ubuntu server to another folder within the ubuntu server and that worked fine.

    Test2
    Second, I tried to copie a local file from the Ubuntu server (Ubuntu 10.04.2 LTS) to a Windows server (192.168.0.174). The Windows is freely accessible, there is no proxy, firewall or any acces restriction. Anyone can go on it. Does it work? Well, it depends how we interpret the feedback: I do not get any error message on screen but after 30min still nothing is copied.

    Test3
    I try to do the same in command line but all tentatives failed:

    If I execute the command : « ssh sudo cp my_script5.sh //192.168.0.174 »

    • I get the error message : « ssh: Could not resolve hostname sudo: Temporary failure in name resolution »


    Althought I'm at the root, I execute the csame command with the full path of the file to be copied,

    • I get the same error message


    If I do a normal transfer, I use the command « sudo cp my_script5.sh //192.168.0.174 »

    • I get an invitation to type in my Ubuntu password and that's what I do.
    • The system brings me back to the root and no further message.


    I've done a ping, from the Ubuntu server to the Windows server and it was successfull.

    Is there a way to complete the script or get to know where it blocks? To complete you with some usefull information: The Ubuntu server is managed by another department and they have granted me (Network Administrator) with full access to some specific folders so I'd be able to copy the requested files. The fact is that I have no acces to create a CRON or create a cache file.

    Any idea?

  2. #2
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    Hidden!
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: SCP command is executed but nothing happens! Nothing is copied.

    I'm no expert on scp but when I have used it, the command should look something like this
    Code:
    scp /home/mark/somefile otheruser@192.168.0.174:/home/otheruser/somefile
    Catch me on Freenode - imark

  3. #3
    Join Date
    Jul 2009
    Beans
    401
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: SCP command is executed but nothing happens! Nothing is copied.

    From your description it's not particularly clear what it is you're trying to achieve.

    The below won't work as you're specifying what would be a command, sudo, where you're supposed to specify the hostname. But as this is a windows box you're trying to connect to it more than likely doesn't support SSH/SCP.
    Quote Originally Posted by saande View Post
    If I execute the command : « ssh sudo cp my_script5.sh //192.168.0.174 »

    • I get the error message : « ssh: Could not resolve hostname sudo: Temporary failure in name resolution »
    You're probably better off first mounting the windows share locally and then copying the files. I've never tried copying the files directly to a windows share (//192.168.0.174/rubbish/) and doubt it works with the cp command.

    When it prompts you for your Ubuntu password, that would be because you're using the sudo command which depending on your sudoers config is required.
    Mark your thread as [SOLVED], use Thread Tools on forum page.

  4. #4
    Join Date
    Sep 2006
    Beans
    7,282
    Distro
    Lubuntu Development Release

    Re: SCP command is executed but nothing happens! Nothing is copied.

    Also mind that Linux uses slashes (/) in paths, not backslashes (\)

    You might want to use sftp instead. That can be used interactively or in batch mode.

  5. #5
    Join Date
    Apr 2013
    Beans
    15

    Re: SCP command

    Hi,

    Thanks for your advice but the windows server has no SFTP or FTP activated/functioning.

  6. #6
    Join Date
    Apr 2013
    Beans
    15

    Re: SCP command is executed but nothing happens! Nothing is copied.

    Indeed, copying it to any Windows share does not work at all. If I copy it to another location/folder on that LInux system it works without any problem. When trying to copy it to a windows share I always get "is not a directory".
    I can ping the windows share, which has a specific IP, but I cannot copy anything on it.

  7. #7
    Join Date
    Apr 2013
    Beans
    15

    Re: SCP command is executed but nothing happens! Nothing is copied.

    When using this or even bashto verify command, I always get cp: target `@19.168.0.174:/pgm' is not a directory

  8. #8
    Join Date
    Sep 2006
    Beans
    7,282
    Distro
    Lubuntu Development Release

    Re: SCP command

    Quote Originally Posted by saande View Post
    Hi,

    Thanks for your advice but the windows server has no SFTP or FTP activated/functioning.
    If you have SSH, then you also have SFTP. It is built into OpenSSH server. It would be possible to turn it off, but it is on by default.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •