0

I'm connecting to my server using JSCH and I can't find the login user with the following commands :

who
w

I found that it's not connected as pts :

# netstat -tuplena | grep :22
  ......    14918/sshd: root

the who command shows only pts : 2764/sshd: root@pts

can anyone explain how it connected without pts and why who can't show it ?


I believe this should be interactive non-login shell , is there any command to run interactive non-login shell from different host ?

0

JSCH is a java implementation of SSH2. You connect directly to a remote server's existing process.
Not a process like you get on login.

If you want to "do things" (port forwarding, X11 forwarding, file transfer) you integrate its as part your own Java programs. It does not create a new user process on the remote site like you seem to want.

  • it's still not clear how to connect directly using existing process. how can I login without "user process" ? is there steps from terminal ? – Mohammad Karmi Oct 15 '18 at 15:45
  • What you need: emulate in java what the system does for a console login unix.stackexchange.com/questions/475480/… – jim mcnamara Oct 15 '18 at 15:53
  • This might be more helpful - create a java console object and then login if you want a plain login: javatpoint.com/java-console-class – jim mcnamara Oct 15 '18 at 16:00
  • you have almost give me the answer , I think this is interactive non login shell right ? what is the command used to enter interactive non login shell ? – Mohammad Karmi Oct 15 '18 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.