[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-10-19 Thread sivaprasad (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17620172#comment-17620172
 ] 

sivaprasad commented on SSHD-1298:
--

Hey Thomas, I tried this way it worked for me.

!image-2022-10-19-15-32-21-146.png!

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png, image-2022-09-28-18-57-02-354.png, 
> image-2022-09-28-18-59-16-962.png, image-2022-09-28-19-05-00-814.png, 
> image-2022-09-28-19-12-17-243.png, image-2022-09-29-18-52-06-070.png, 
> image-2022-10-19-15-32-21-146.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-10-01 Thread Thomas Wolf (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17611975#comment-17611975
 ] 

Thomas Wolf commented on SSHD-1298:
---

I really cannot help you debug sudo setup problems on the target server. As far 
as invoking sudo and passing the password is concerned, your code worked, 
otherwise sudo would have complained differently. I don't know why sudo then 
does not allow to run the command.

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png, image-2022-09-28-18-57-02-354.png, 
> image-2022-09-28-18-59-16-962.png, image-2022-09-28-19-05-00-814.png, 
> image-2022-09-28-19-12-17-243.png, image-2022-09-29-18-52-06-070.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-29 Thread sivaprasad (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610949#comment-17610949
 ] 

sivaprasad commented on SSHD-1298:
--

I tried as you said but still got the same issues. previously  we used a jscape 
to execute ssh commands. jscape has a session.sendwait method it can handle 
these things. recently we migrated to apache mina, for regular users mina 
working as expected, but here are issues with sudo users only.

- in ctssh sudo command execution.   -

[sudo] password for siva:
Sorry, user siva is not allowed to execute '/bin/su - oracle -c ls -lrt' as 
root on esx3ebs122603.
- exit status of command: 1
- out from ctssh sudo command execution.   -

When I ran the same command with jscape below is the output

[siva@esx3ebs122603~]$ Last login: Sat Jul 30 05:31:23 CDT 2022^M
[oracle@esx3ebs122603~]$ total 40^M
drwxrwxrwx. 2 oracle oinstall 4096 Jun  1 12:21 template^M
drwxrwxrwx. 2 oracle oinstall 4096 Jun  1 12:21 patches^M
drwxrwxrwx. 2 oracle oinstall 4096 Jun  1 12:21 bak^M
drwxrwxrwx. 2 oracle oinstall 4096 Jun  1 12:21 conf^M
drwxrwxrwx. 2 oracle oinstall 4096 Jun  1 12:21 dumps^M
drwxrwxrwx. 3 oracle oinstall 4096 Jun  3 01:27 bin^M
drwxrwxrwx. 3 oracle oinstall 8192 Jul 30 02:02 out^M
drwxrwxrwx. 2 oracle oinstall 4096 Jul 30 05:30 sql^M
[oracle@esx3ebs122603~]$ 0^M
[oracle@esx3ebs122603~]$ ===0^M
[oracle@esx3ebs122603~]$
*** Status of command from jscape is: 0^M

please let me know if anything wrong in mycode.

!image-2022-09-29-16-19-49-398.png!  

 

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png, image-2022-09-28-18-57-02-354.png, 
> image-2022-09-28-18-59-16-962.png, image-2022-09-28-19-05-00-814.png, 
> image-2022-09-28-19-12-17-243.png, image-2022-09-29-16-16-41-364.png, 
> image-2022-09-29-16-17-21-407.png, image-2022-09-29-16-19-49-398.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-29 Thread Thomas Wolf (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610844#comment-17610844
 ] 

Thomas Wolf commented on SSHD-1298:
---

{quote}
without passing a password how you established a session?
{quote}

Public key authentication; setup not shown in the snippet.

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png, image-2022-09-28-18-57-02-354.png, 
> image-2022-09-28-18-59-16-962.png, image-2022-09-28-19-05-00-814.png, 
> image-2022-09-28-19-12-17-243.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-29 Thread sivaprasad (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610825#comment-17610825
 ] 

sivaprasad commented on SSHD-1298:
--

Your question : What is the benefit of connecting via SSH and then sudoing over 
connecting via SSH to an account that has the correct rights already?

reply to your question

The sudo user (siva) doesn't have all rights to execute commands so we are 
sudoing from siva to oracle to executing the commands. the sudo user is only 
used for auditing purposes, for example, if there are thousands of employees in 
the organization each one has his own credentials by using their credentials to 
connect machine after that they need to checkout to the oracle (passwordless) 
user to execute the commands this way organization will track who runs which 
commands.

 

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png, image-2022-09-28-18-57-02-354.png, 
> image-2022-09-28-18-59-16-962.png, image-2022-09-28-19-05-00-814.png, 
> image-2022-09-28-19-12-17-243.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-29 Thread sivaprasad (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610814#comment-17610814
 ] 

sivaprasad commented on SSHD-1298:
--

one question thomas, in your code 
(ClientSession session = client.connect("bob", actualHost, 
actualPort).verify(CONNECT_TIMEOUT).getSession()) {
session.auth().verify(AUTH_TIMEOUT);
 without passing a password how you established a session?

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png, image-2022-09-28-18-57-02-354.png, 
> image-2022-09-28-18-59-16-962.png, image-2022-09-28-19-05-00-814.png, 
> image-2022-09-28-19-12-17-243.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-29 Thread sivaprasad (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610812#comment-17610812
 ] 

sivaprasad commented on SSHD-1298:
--

yeah sure, I will go through the SFTP. as of now we are uploading one location 
with sudo user credentials, once we upload that location. from that location, 
we are doing cp as an oracle user to the destination path.

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png, image-2022-09-28-18-57-02-354.png, 
> image-2022-09-28-18-59-16-962.png, image-2022-09-28-19-05-00-814.png, 
> image-2022-09-28-19-12-17-243.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-28 Thread Thomas Wolf (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610810#comment-17610810
 ] 

Thomas Wolf commented on SSHD-1298:
---

To answer your original question at least partly:
{quote}
is there any better way to handle sudo user related command execution, file 
upload and downloads with Apachemina?
{quote}
For file uploads or downloads look at SFTP.

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png, image-2022-09-28-18-57-02-354.png, 
> image-2022-09-28-18-59-16-962.png, image-2022-09-28-19-05-00-814.png, 
> image-2022-09-28-19-12-17-243.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-28 Thread Thomas Wolf (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610615#comment-17610615
 ] 

Thomas Wolf commented on SSHD-1298:
---

sudo complains that user *ctadmin* was not allowed to run {{{}su{}}}. So if it 
works for user "siva", that doesn't tell anything. Check that user ctadmin can 
execute that command. Or connect via SSH as user "siva".

As for writing the password through the channel's {{{}stdin{}}}: the following 
works for me:
{code:java}
try (ClientSession session = client.connect("bob", actualHost, 
actualPort).verify(CONNECT_TIMEOUT).getSession()) {
session.auth().verify(AUTH_TIMEOUT);
try (ChannelExec exec = session.createExecChannel("sudo -S su - root -c 
whoami")) {
exec.open().verify(OPEN_TIMEOUT);
try (OutputStream channelInput = exec.getInvertedIn()) {

channelInput.write("passwordBob\n".getBytes(StandardCharsets.US_ASCII)); // 
Don't forget the '\n'!
channelInput.flush();
try (BufferedReader channelOutput = new BufferedReader(
new InputStreamReader(exec.getInvertedOut(), 
StandardCharsets.UTF_8))) {
String line;
do {
line = channelOutput.readLine();
if (line != null) {
System.err.println(">> " + line);
}
} while (line != null);
}
}
System.err.println("Exit code of command: " + exec.getExitStatus());
}
}
{code}
This prints
{code:java}
>> root
Exit code of command: 0
{code}
It also works with the command "{{{}sudo -S whoami{}}}", or "{{{}sudo -S -u 
root whoami{}}}". (User "bob" has the password "passwordBob" and is listed in 
sudoers of course.) You need to write the {{{}'\n'{}}}; otherwise {{sudo}} will 
keep waiting for more input for the password.

Note that the above is _not_ production-quality code; in a real application 
you'd probably want to handle the channel's {{{}stderr{}}}, too, and maybe feed 
the password only if {{sudo}} asks for it, not have the password hard-coded, 
and so on.

What is the benefit of connecting via SSH and then sudoing over connecting via 
SSH to an account that has the correct rights already?

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png, image-2022-09-28-18-55-13-239.png, 
> image-2022-09-28-18-57-02-354.png, image-2022-09-28-18-59-16-962.png, 
> image-2022-09-28-19-05-00-814.png, image-2022-09-28-19-08-56-706.png, 
> image-2022-09-28-19-12-17-243.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-28 Thread sivaprasad (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610584#comment-17610584
 ] 

sivaprasad commented on SSHD-1298:
--

Hi Thomas, 

1. I manually ran the command by using the -S option on Linux, and it executed 
successfully. but When I run the same query with code it's not worked.

Manual execution snip in Linux.

!image-2022-09-28-19-05-00-814.png!

My Code flow

!image-2022-09-28-19-12-17-243.png!   

Below  error, i am getting when i ran the same command from the code side

- in sudo ssh command execution.   -

[sudo] password for ctadmin: Sorry, user ctadmin is not allowed to execute 
'/bin/su - oracle -c ls -lrt' as root on esx3ebs122603.

- status of command             : 1

- out from sudo ssh command Execution.   -

2.  I tried with a channel.invertedIn(), I feed the password, but it was 
stucked.

3.  I am a sudo user so my username and password are only for ssh connection, 
once i connected i need to check out the oracle user without giving the 
password. this is passwordless access for my user.  to checkout the oracle 
prompt for executing a command I am using both.

siva is a sudo user.

!image-2022-09-28-18-57-02-354.png!

4. I checked with my Unix team they set up/etc/sudoers properly.

!image-2022-09-28-18-59-16-962.png!

5. Once i executed the command manually in Linux if it is working then i will 
execute it with code.

All these things code and servers are on remote desktops,  we don't have the 
option to copy. So due to that, I am sharing screenshots instead of text. Sorry.

So my aim is,  once I open a session with my sudo username and password I need 
to check out the oracle user prompt to execute the commands. to check out the 
oracle prompt I no need to give a password it's passwordless access.

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png, image-2022-09-28-18-55-13-239.png, 
> image-2022-09-28-18-57-02-354.png, image-2022-09-28-18-59-16-962.png, 
> image-2022-09-28-19-05-00-814.png, image-2022-09-28-19-08-56-706.png, 
> image-2022-09-28-19-12-17-243.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-27 Thread Thomas Wolf (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610275#comment-17610275
 ] 

Thomas Wolf commented on SSHD-1298:
---

BTW, you can paste test and format it as code in Jira. (It's in the "+" 
drop-down menu.) That's should be easier for you than taking screenshots, and 
it'd be more convenient for everybody else.

 

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-27 Thread Thomas Wolf (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610273#comment-17610273
 ] 

Thomas Wolf commented on SSHD-1298:
---

# I don't see any {{-S}} in that command.
 # It should be possible to feed the password by writing to 
{{{}channel.getInvertedIn(){}}}.
 # If you just want to execute a command, why are you using {{{}su{}}}? Just 
{{sudo}} should do.
 # Check that {{sudo}} and /etc/{{{}sudoers{}}} are set up correctly.
 # First make sure the command works when done manually in an interactive SSH 
shell.

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-27 Thread sivaprasad (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17610082#comment-17610082
 ] 

sivaprasad commented on SSHD-1298:
--

Hai Thomas, even though i  provide a password within a command it's still 
asking for a password.

!image-2022-09-27-19-34-06-130.png!

error:

[sudo] password for oracle:
sudo: timed out reading password

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-18-01-38-617.png, 
> image-2022-09-23-18-02-25-225.png, image-2022-09-23-18-04-29-364.png, 
> image-2022-09-27-19-34-06-130.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-23 Thread Thomas Wolf (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17608898#comment-17608898
 ] 

Thomas Wolf commented on SSHD-1298:
---

{quote}how to contact paid support team of apache mina SSHD?{quote}

There is no "paid support team of apache mina SSHD".

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-17-49-38-155.png, 
> image-2022-09-23-18-01-38-617.png, image-2022-09-23-18-02-25-225.png, 
> image-2022-09-23-18-04-29-364.png
>
>
> Hi Team,
> To establish the Session connection, I am using a regular username(siva) and 
> password(siva).  once a session is created successfully, by using the same 
> session I need to check out another sudo user 'oracle' to execute a command 
> on Linux or Solaris, why is because this oracle user(passwordless access for 
> this user) has those permissions to execute commands. here i  attached the 
> sample code i am using now. but it is working in some cases only. sometimes 
> commands are giving 1 as existstatus and the error stream throws an error 
> message even though I allocated pty to the session properly. someone, please 
> help me how to overcome this. 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-23 Thread sivaprasad (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17608892#comment-17608892
 ] 

sivaprasad commented on SSHD-1298:
--

If you share some code on how to feed the password via stdin that would very 
help full for me. anyway, how to contact paid support team of apache mina SSHD?

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-17-49-38-155.png, 
> image-2022-09-23-18-01-38-617.png, image-2022-09-23-18-02-25-225.png, 
> image-2022-09-23-18-04-29-364.png
>
>
> Hi Team,
> How can we execute commands by using the Sudo credentials? 
> example: to establish the Clientsession connection, I am using a regular 
> username and password.  by using the same session I need to check out another 
> Sudo user oracle to execute a command on Linux because only an oracle user 
> has those permissions to execute commands.
> here i  attached the sample code i am using now. but it is working in some 
> cases only. some times throwing some errors 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-23 Thread Thomas Wolf (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17608877#comment-17608877
 ] 

Thomas Wolf commented on SSHD-1298:
---

None that I know of.

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-17-49-38-155.png, 
> image-2022-09-23-18-01-38-617.png, image-2022-09-23-18-02-25-225.png, 
> image-2022-09-23-18-04-29-364.png
>
>
> Hi Team,
> How can we execute commands by using the Sudo credentials? 
> example: to establish the Clientsession connection, I am using a regular 
> username and password.  by using the same session I need to check out another 
> Sudo user oracle to execute a command on Linux because only an oracle user 
> has those permissions to execute commands.
> here i  attached the sample code i am using now. but it is working in some 
> cases only. some times throwing some errors 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1298) password less sudo user commands execution and file.

2022-09-23 Thread sivaprasad (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17608871#comment-17608871
 ] 

sivaprasad commented on SSHD-1298:
--

Hey Thomas thanks for the response, is there any sample source code for this 
issue.

> password less sudo user commands execution and file.
> 
>
> Key: SSHD-1298
> URL: https://issues.apache.org/jira/browse/SSHD-1298
> Project: MINA SSHD
>  Issue Type: Improvement
> Environment: Java 1.8, Linux, Solaris.
>Reporter: sivaprasad
>Priority: Blocker
> Attachments: image-2022-09-23-17-49-38-155.png, 
> image-2022-09-23-18-01-38-617.png, image-2022-09-23-18-02-25-225.png, 
> image-2022-09-23-18-04-29-364.png
>
>
> Hi Team,
> How can we execute commands by using the Sudo credentials? 
> example: to establish the Clientsession connection, I am using a regular 
> username and password.  by using the same session I need to check out another 
> Sudo user oracle to execute a command on Linux because only an oracle user 
> has those permissions to execute commands.
> here i  attached the sample code i am using now. but it is working in some 
> cases only. some times throwing some errors 
> !image-2022-09-23-18-04-29-364.png!
>  
> !image-2022-09-23-18-01-38-617.png!
>  
> !image-2022-09-23-18-02-25-225.png!
>  
> is there any better way to handle sudo user related command execution, file 
> upload and downloads with Apachemina?
>  
> Thanks,
> Siva
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org