Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: SCP issue

  1. #11
    Join Date
    May 2007
    Beans
    80

    Re: SCP issue

    Thank you for your response. I really don't understand why I get this error:

    home@laptop:~$ rsync --rsync-path='sudo rsync' -av xxx@xxx.prgmr.com:ali.txt /home

    sudo: sorry, you must have a tty to run sudo
    protocol version mismatch -- is your shell clean?
    (see the rsync man page for an explanation)
    rsync error: protocol incompatibility (code 2) at compat.c(174) [Receiver=3.0.8]

  2. #12
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: SCP issue

    It sounds like something isn't configured correctly. Have you checked that you can use ssh to login on that server without similar problems. After login try to use the sudo command manually. eg. "sudo ls -lsa".

    I've never seen that tty error. But doing a google gives me this,
    http://www.cyberciti.biz/faq/linux-u...haveattytorun/

    which seems to say that some systems need to have the -t option for ssh to work correctly. IF that's the case then with rsync you would need something like,

    rsync -e "ssh -t" --rsync-path='sudo rsync' -av xxx@xxx.prgmr.com:ali.txt /home

    Ubuntu server doesn't usually have this issue in my experience so perhaps your server is running some pther Linux?
    Send tips to: 17raXAGM42vZX21Vcb5HDwq2GMLmVwN4qd

  3. #13
    Join Date
    May 2007
    Beans
    80

    Re: SCP issue

    Well I've no problem with SSH. However according to this because of shell initialization. So I'm quiet sure the reason SCP & rsync fails is related to the fact that when I connect to my VPS there is running script. This is because when I run the following command:

    "ssh xx@rxx.prgmr.com /usr/bin/true" I get this:

    Options for xxx
    1. out of band console (press ctrl-] to escape, not resizeable)
    2. create/start (try this if the vps "does not exist")
    3. shutdown
    4. destroy/hard shutdown
    5. reboot
    6. swap i386/amd64 bootloaders (pvgrub) currently amd64
    7. view/add/remove ssh authorized_keys
    8. exit
    press the number> sudo: sorry, you must have a tty to run sudo
    Should I configure initializer or the shell?
    Regards

  4. #14
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: SCP issue

    If the server has been configured to restrict ssh logins to only a specific program (menu) then you will not be able to run other programs over ssh such as rsync, scp etc.

    You can check this by looking at the /etc/ssh/sshd_config on the server. Look for the ForceCommand statement.
    Send tips to: 17raXAGM42vZX21Vcb5HDwq2GMLmVwN4qd

  5. #15
    Join Date
    May 2007
    Beans
    80

    Re: SCP issue

    I went through sshd_config file
    vi /etc/ssh/sshd_config
    and I entered that ForceCommand. I've still the same problem. Is my command right?

    ForceCommand sudo /root/scp

    How about rsync?

    Thanks

  6. #16
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: SCP issue

    No. You want to see if the command is there and remove it. If you don't have root access on the server then you cannot do that. That command forces the login to only allow that one command.

    Also that is not the only way of restricting you. If your login shell has been replaced then that would also cause a problem like this. You probably need to contact whoever admins that system and ask about how to do what you want. It sounds like they have taken steps to restrict what you can do.
    Send tips to: 17raXAGM42vZX21Vcb5HDwq2GMLmVwN4qd

  7. #17
    Join Date
    May 2007
    Beans
    80

    Re: SCP issue

    Quote Originally Posted by BkkBonanza View Post
    No. You want to see if the command is there and remove it. If you don't have root access on the server then you cannot do that. That command forces the login to only allow that one command.

    Also that is not the only way of restricting you. If your login shell has been replaced then that would also cause a problem like this. You probably need to contact whoever admins that system and ask about how to do what you want. It sounds like they have taken steps to restrict what you can do.
    Ok friend, it was very kind of you. I don't find how to mark your post as asnwer. Tell me if this possibility exists, otherwise thank you again.

  8. #18
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Marking a thread as solved

    Quote Originally Posted by aliov_85 View Post
    I don't find how to mark your post as asnwer.

    Go to the top of the page and select the link "Thread Tools" From there, one choice is to mark the thread as "Solved"

  9. #19
    Join Date
    May 2007
    Beans
    80

    Re: SCP issue

    Hello, I've checked my administrator. He told me to create a no-root user. So I'm pretty sure that I don't have anymore the problem initial configuration of bash.

    But I've still problems copying files from server to local.

    SCP:
    I get this:
    david@XXX.xxx.prgmr.com's password:
    ali.txt 100% 26 0.0KB/s 00:00
    With rsync I've the following error:

    rsync error: error in rsync protocol data stream (code 12) at io.c(601) [Receiver=3.0.8]
    Do you know why?

  10. #20
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: SCP issue

    Please post the full line you are using with rsync.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

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
  •