This project is read-only.

Connecting as username@host

Aug 6, 2012 at 7:45 AM

Hi guys,

My server is configured somehow that only when connectin like username@host some login scripts run and create environment variables which I need.

My problem is that when connecting the regular way like below, the login scripts are not started.

new SshClient(host, username, password)

Could you guide me here please?

Thanks a lot

Aug 6, 2012 at 7:08 PM

Hi Ilyabad,

 

- Is it that only your environment variables are not set or you are unable to login with the SshClient() method?

 

If you are unable to login, I would suggest trying out Keyboard authentication method. I had to use this method for connecting to SUSE linux server. 

As far as your environment variables are concerned, did you try adding those variables in your .bashrc or .cshrc  in your home directory (the home directory of the user that you are logging in as )depending on your shell. The get sourced automatically when you login. 

 

Hope this helps.

 

Thanks,

Subbu.

Aug 23, 2012 at 1:50 PM

Thanks for the reply.

The funny thing is that when I read the variables with ShellStream I do see all the variables but if I just use client.RunCommand than I see only basic variables, not the ones which are created when logging in.

So this is great, and I could work with this, but I have an issue that creating a ShellStream takes a view minutes(!) while just connecting and executing command with a client takes a view seconds.

Do you have any idea regarding this behaviour? What could I do here?

BTW, I can't add variables to .bashrc because of different constraints.

This is the line that takes a long time,

ShellStream shellStream = client.CreateShellStream("xterm", 80, 24, 800, 600, 1024);

Thanks a lot