Comments (4)
is this something you can workaround by using userAuthPrivateKeyLocation ?
Example:
Profile remoteProfileWithPublicKey = ProfileBuilder.newBuilder()
.name("Another remote server log")
.filePath("/path/to/file/filename.txt")
.onRemotehost("172.x.x.x")
.userAuthPrivateKeyLocation("/home/user/.ssh/id_dsa")
.withUser("user")
.build();
Original comment by [email protected]
on 12 Dec 2013 at 12:14
from grep4j.
Thank for your answer!
I tried your way before address to you, but was exception too (full stack
trace):
Exception in thread "main" java.lang.RuntimeException: Error when executing the
GrepTask
at org.grep4j.core.executors.GrepExecutor.execute(GrepExecutor.java:59)
at org.grep4j.core.executors.GrepExecutor.execute(GrepExecutor.java:27)
at org.grep4j.core.Grep4j.execute(Grep4j.java:239)
at org.grep4j.core.Grep4j.grep(Grep4j.java:145)
at org.grep4j.core.Grep4j.grep(Grep4j.java:213)
at ua.privatbank.eantifraud.client.core.resource.EntryPointResource.main(EntryPointResource.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException:
Error when executing the CommandExecutorTasks
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at org.grep4j.core.executors.GrepExecutor.execute(GrepExecutor.java:54)
... 10 more
Caused by: java.lang.RuntimeException: Error when executing the
CommandExecutorTasks
at org.grep4j.core.executors.GrepTaskExecutor.execute(GrepTaskExecutor.java:51)
at org.grep4j.core.executors.GrepTaskExecutor.execute(GrepTaskExecutor.java:25)
at org.grep4j.core.task.GrepTask.call(GrepTask.java:51)
at org.grep4j.core.task.GrepTask.call(GrepTask.java:31)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException:
ERROR: Unrecoverable error when performing remote command ERROR: Unrecoverable
error when trying to connect to serverDetails :
ServerDetails(host=remote.host, user=eanfuser, password=null, port=22,
privateKeyLocation=/home/user/.ssh/id_rsa, isPasswordRequired=false)
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at org.grep4j.core.executors.GrepTaskExecutor.execute(GrepTaskExecutor.java:48)
... 7 more
Caused by: java.lang.RuntimeException: ERROR: Unrecoverable error when
performing remote command ERROR: Unrecoverable error when trying to connect to
serverDetails : ServerDetails(host=remote.host, user=eanfuser, password=null,
port=22, privateKeyLocation=/home/user/.ssh/id_rsa, isPasswordRequired=false)
at org.grep4j.core.command.linux.JschCommandExecutor.execute(JschCommandExecutor.java:46)
at org.grep4j.core.task.CommandExecutorTask.call(CommandExecutorTask.java:35)
at org.grep4j.core.task.CommandExecutorTask.call(CommandExecutorTask.java:19)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
... 4 more
Caused by: java.lang.RuntimeException: ERROR: Unrecoverable error when trying
to connect to serverDetails : ServerDetails(host=remote.host, user=eanfuser,
password=null, port=22, privateKeyLocation=/home/user/.ssh/id_rsa,
isPasswordRequired=false)
at org.grep4j.core.command.linux.SessionFactory.makeObject(SessionFactory.java:39)
at org.grep4j.core.command.linux.SessionFactory.makeObject(SessionFactory.java:15)
at org.apache.commons.pool.impl.StackKeyedObjectPool.borrowObject(StackKeyedObjectPool.java:165)
at org.grep4j.core.command.linux.JschCommandExecutor.execute(JschCommandExecutor.java:37)
... 8 more
Caused by: com.jcraft.jsch.JSchException: Auth cancel
at com.jcraft.jsch.Session.connect(Session.java:490)
at com.jcraft.jsch.Session.connect(Session.java:162)
at org.grep4j.core.command.linux.SessionFactory.makeObject(SessionFactory.java:37)
... 11 more
But I'm sure, there're no problems with my permission to server - I can get
into server by console
Code I'm using:
Profile profile = ProfileBuilder.newBuilder()
.name("Another")
.filePath("/opt/eantifraud-processor/log/log.log")
.onRemotehost("remote.host") //I tried IP of host too
.userAuthPrivateKeyLocation("/home/user/.ssh/id_rsa")
.withUser("user")
.build();
grep(constantExpression(myId), on(profile));
Original comment by [email protected]
on 12 Dec 2013 at 1:21
from grep4j.
Did you generated a pair of authentication keys?
see http://www.linuxproblem.org/art_9.html
If you have a AuthPrivateKeyLocation you should point to your specific id_rsa,
the code you are using is using the same as the grep4j example
/home/user/.ssh/id_rsa which i doubt is your correct location.
Original comment by [email protected]
on 13 Dec 2013 at 12:51
from grep4j.
May be too late to come to this page.. This is the same issue I had faced with
remote access without requiring a password or "sudo". The solution explained in
http://www.linuxproblem.org/art_9.html will resolve the issue. Only thing you
need to do is to specify a correct RSA private key location.
Grep4j correctly returns the results after that.
Original comment by [email protected]
on 21 Apr 2014 at 7:22
from grep4j.
Related Issues (18)
- Profiles should not be stored by the api HOT 2
- Test coverage must be improved HOT 1
- Profile Password must be encrypted HOT 1
- More Java Doc required HOT 1
- Grep4j.execute run twice execute three times search HOT 2
- Compiler that should be used for the project is 1.6 instead of 1.5 HOT 1
- [deleted issue]
- Port needed to connect to remote server HOT 2
- Support authentication using public key HOT 19
- GrepResult#linePattern HOT 5
- Grep4j does not find strings which start with "-". HOT 4
- grep doesn't work with files having space in their names HOT 1
- Getting this exception when the total time for search is longer . (i.e) grepping through 8 server and 24 files each
- Iteration not working properly on GrepResults HOT 1
- com.jcraft.jsch.JSchException: Auth fail
- No exception when the log path is wrong
- Grep not working with simple quote
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grep4j.