bob manc skribis: > I am trying to use jsch to scp or sftp files to and from my ubuntu > server. I have to login as ubuntu but want to do a 'sudo su -' > command so I can overwrite files owned by root.Is there a way to do > this on a session that will allow me to be root on subsequent calls?
The command sudo su - is not a command which is executed once and then leaves the current session in a "root" state, but it simply spawns a new shell in root mode - when you exit this shell, you are back in your original non-root shell. So we would have to execute the server part of scp or sftp inside this shell, and speak to it in the same channel as the shell. Maybe using a tunneled sftp (with the -S and/or -s options) could help here. Or simply '-s sudo sftp-server' or similar? (Doesn't work this simple, it seems.) I don't even have an idea how to do this with normal ssh, even less with JSch, sorry. But maybe this helps that you (or someone else) finds some ideas. Paul
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________ JSch-users mailing list JSch-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jsch-users