LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] rsync + switching user after connection

[ILUG] rsync + switching user after connection

Darragh Bailey felix at compsoc.nuigalway.ie
Tue Nov 16 22:19:32 GMT 2004


Trying to use rsync to update a local copy of a website from the one sitting on
a server.

Normally I can use

rsync -vare ssh user at host:src_dir/* local_dir/ --exclude-from=local_dir/EXCL

But in this case I need to be able to switch user after login in order to
retreive the files fully due to permissions, before any one askes its not root,
but a common website editing account shared between a few members. Additionally
loging in remotely as the shared user will not work either.


I was looking at
rsync -var --rsh="ssh -l user host su - new_user" :src_dir/* local_dir/
--exclude-from=local_dir/EXCL

But rsync terminates the connection. Is it possible to do it this way, in which
case could someone point out what I'm missing or do I have to resort to a script
in order to be able to perform this?


output from rsync is

bash: su - new_user: command not found
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(342)


experimenting from the command line with just ssh gets the message
su: must be run from a terminal

So that suggests what the problem rsync is having but isn't any assistance in
building a new command line that would work.

Setting up a script on the far side to run when I login is no good since I
sometimes need to be able to ssh in without becoming a different user
afterwards.

Additionally taring and bziping the website up and downloading it is not really
an option. Once in a while that can be done, the rest of the time I need to be
able to use either rsync over ssh or some other system than only retreives
modified files over ssh.

--
Darragh

"Nothing's foolproof to a sufficently talented fool"



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell