bobble14988 / sshxcute

Automatically exported from code.google.com/p/sshxcute
0 stars 0 forks source link

Unable to execute sudo command #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Login with a normal user using normal way to connect 
For eg. Command-> ConnBean cb = new ConnBean(ip,username,password);
ssh = SSHExec.getInstance(cb);
    ssh.connect();
2. Once connected try to execute following command:
 CustomTask pwd3  = new  ExecCommand("sudo su -userid ") ;
  ssh.exec(pwd3);

What is the expected output? What do you see instead?
Expected output: able to login as a sudo user
Error message: sudo: sorry, you must have a tty to run sudo

What version of the product are you using? On what operating system?

Please provide any additional information below.
exception detail net.neoremind.sshxcute.exception.TaskExecFailException: The 
task has failed to execute 

Original issue reported on code.google.com by sameer.b...@gmail.com on 7 Mar 2013 at 4:50

GoogleCodeExporter commented 9 years ago
I am facing the same problem

I want to do the folowing thing like sudo su - <UserName>.it will prompt for a 
password.To avoid the prompting  i am using like this sudo -S su - netaware.

The method works well in command prompt but in ssh execute.it is getting stuch 
with the following log.

trying to connect
SSHExec initializing ...
Session initialized and associated with user credential password
SSHExec initialized successfully
SSHExec trying to connect user@host
SSH connection established
Command is sudo -S su - user
Connection channel established succesfully
Start to run command

Original comment by sanjayku...@gmail.com on 10 Sep 2013 at 2:01

GoogleCodeExporter commented 9 years ago
Please somebody reply i need to quickly figure out a solution.I am using putty 
as a terminal

Original comment by sanjayku...@gmail.com on 10 Sep 2013 at 2:03

GoogleCodeExporter commented 9 years ago
try with "echo sudo su"

Original comment by rawoof...@gmail.com on 15 Nov 2013 at 12:03

GoogleCodeExporter commented 9 years ago
After connecting with "echo sudo username", how to enter passwrod for username 
through java code

Original comment by raja.sek...@gmail.com on 7 Dec 2013 at 3:58

GoogleCodeExporter commented 9 years ago
Hi raja.sek 

were you able to solve this problem, i am facing the same kind of prob.

Original comment by sujan...@gmail.com on 3 Jun 2014 at 7:15

GoogleCodeExporter commented 9 years ago
Do any one know solution for this problem yet?

Original comment by rmaheedh...@gmail.com on 13 May 2015 at 7:48