How can I set in the bitvise ssh client, the tunnel automatic connect if open windows or restart windows?

4

2

Now the tunnel works if I open the bitvise application and click the login button. I want to change that. I want the tunnel automatic open if open windows or restart windows

Where I can set the automatic tunnel to open when opening windows or restarting windows?

The options tab in the bitvise ssh client like this :

enter image description here

I'm still confused to set it?

Please help me

Success Man

Posted 2018-08-29T12:54:05.490

Reputation: 161

Answers

4

The Bitvise SSH Client user interface does not provide an option to start the profile automatically when Windows 10 starts up. Instead, you can create a shortcut to Bitvise with the "-loginOnStartup" option. The steps below are a lot easier than creating a batch file.

  1. In your Bitvise Profile, select these options:
    • Uncheck "Open Terminal"
    • Uncheck "Open SFTP"
    • If using password authentication, check "Store encrypted password in profile"
  2. Click the "Save profile as" button and save the profile, e.g. to "%USERPROFILE%\Documents\BitviseProfile.tlp". You may see a message letting you know that sensitive information will be saved in the profile.
  3. Open the folder "%PROGRAMFILES(X86)%\Bitvise SSH Client" in one Explorer window, and the "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup" folder in another Explorer window. (If you copy and paste the locations into Explorer, they will automatically expand to the correct folders for your system.)
  4. Right-click on BvSsh.exe and drag it to the Startup folder, and select "Create shortcuts here" from the context menu. Rename the new shortcut like "auto-start bitvise ssh tunnel"
  5. Right-click the new shortcut and select "Properties"
  6. In the "Target" setting, enter the following, taking care to set the profile path to the actual path of your Bitvise profile:

    "C:\Program Files (x86)\Bitvise SSH Client\BvSsh.exe" -profile="C:\Users\Me\Documents\BitviseProfile.tlp" -loginOnStartup

  7. Click "OK"

  8. Double-click the shortcut and verify that Bitvise started up correctly
  9. You can also verify that if you go to "Startup Apps" in Windows Settings, you see an entry for "Bitvise SSH Client"
  10. Reboot windows and confirm that Bitvise started up correctly

humbads

Posted 2018-08-29T12:54:05.490

Reputation: 141

1thank you, very helpful. in addition to -loginOnStartup option, two more command-line switches -exitOnLogout -hide=main will automatically close the terminal and GUI windows after the SSH session is terminated. – user1082 – 2019-05-21T15:30:45.737

Thanks @user1082. Those options can be selected from the profile though. I noted that in the answer. – humbads – 2019-05-21T17:44:09.423

0

You can add it to the startup group, so that it loads when you log in to Windows.

Last I checked, there was an issue where the System Tray icon wouldn't show up if the Bitvise SSH Client loaded before the taskbar itself was loaded. Because of that, I used a batch file and put a big sleep right into the batch file.

If Bitvise has fixed things so that it works if they load before the taskbar does, then you could do this with a Windows Shortcut as well. It would have to be a shortcut to BvSsh.exe, rather than to the saved connection, because you need to pass the -loginOnStartup parameter.

Obviously, this all requires that you have the connection set up so that you don't have to type an SSH password.

C:\Users\dyaw\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup> dir
 Volume in drive C is OS
 Volume Serial Number is 06C9-85F1

 Directory of C:\Users\dyaw\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

08/10/2018  01:43 PM    <DIR>          .
08/10/2018  01:43 PM    <DIR>          ..
05/26/2015  10:39 AM               319 Bitvise SSH Clients.bat
               1 File(s)            319 bytes
               2 Dir(s)  236,144,820,224 bytes free

C:\Users\dyaw\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup> type "Bitvise SSH Clients.bat"
@echo off

timeout 30 /nobreak

start "" "C:\Program Files (x86)\Bitvise SSH Client\BvSsh.exe" -profile=C:\Users\dyaw\Documents\server.tlp -loginOnStartup

REM Delay a bit so that the two icons are always in the same order in the System Tray
timeout 1 /nobreak

start "" "C:\Program Files (x86)\Bitvise SSH Client\BvSsh.exe" -profile=C:\Users\dyaw\Documents\linux.tlp -loginOnStartup

C:\Users\dyaw\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup>

Note: The directory shown above is the one for Windows 7. New versions of Windows may have moved the Start Menu.

David Yaw

Posted 2018-08-29T12:54:05.490

Reputation: 607

I use windows 10. I tried running statements one by one like this : https://postimg.cc/image/ac1o3bibl/. Then I restart my windows. It just display like this : https://postimg.cc/image/gczd0hke9/. The tunnel doesn't automatically open

– Success Man – 2018-09-01T05:34:32.760

Your batch file lists the filenames server.tlp and linux.tlp, in directory C:\Users\[username]\Documents, but your SSH Client shows that it loaded C:\[something]\key\[something]\SFTP1_Profile.tlp. Does the file server.tlp exist in your My Documents directory? Which file do you want to load & autoconnect? – David Yaw – 2018-09-01T22:15:19.260

Also, you have SFTP1_Profile.tlp set to connect via "publickey+password". This may require manual keyboard interaction, which would interfere with the auto-connection you're trying to set up. – David Yaw – 2018-09-01T22:26:04.043

Okay thanks. But this row : start "" "C:\Program Files (x86)\Bitvise SSH Client\BvSsh.exe" -profile=C:\Users\dyaw\Documents\linux.tlp -loginOnStartup. What is it used for? That seems unnecessary – Success Man – 2018-09-02T08:17:07.290

I change via "publickey". It's the same. If I restart windows, the tunnel still not open. I must click button login first – Success Man – 2018-09-02T09:05:55.470

What do you think? – Success Man – 2018-09-03T01:19:30.970

RE: What does this row do? It does the same thing as the first one, it loads the SSH Client and connects. I have two servers that I connect to, so I load two copies of the SSH Client. And did you change your script so that it loads your saved profile instead of my saved profiles server.tlp and linux.tlp? – David Yaw – 2018-09-04T04:21:42.297

Yeah, I just load my profile. Now it works. But the tunnel is not automatic. If I restart my windows, It will display like this : https://postimg.cc/image/6cdl97hul/. If I want the tunnel open, I must click login button first

– Success Man – 2018-09-04T06:31:32.607

I'm using an older version of the SSH Client. (I'm using 7.29, you're on 7.45.) Perhaps the supported command line parameters have changed over time? What does running BvSsh -help, as the output window suggests, show? – David Yaw – 2018-09-04T16:40:12.103

Also, can you show the actual batch file you're running at startup? As of the last screenshot you showed, you had a link named "Bitvise SSH Client.lnk", which looks like a link to the program, not to your batch file. If you're just running SSH Client at startup, not the batch file, that would explain why it's not trying to connect at startup. – David Yaw – 2018-09-04T19:53:40.597

If I run BvSsh -help in the command prompt, the result like this : https://postimg.cc/image/u93tjht1j/. My start up like this : https://postimg.cc/image/ar963l6ef/

– Success Man – 2018-09-05T00:26:13.007

You only have a shortcut to the SSH Client Program in your startup group. Where did you put the command line I listed in my answer? Is it in that shortcut? If so, show the "Shortcut" tab of the shortcut's properties. – David Yaw – 2018-09-05T00:43:31.050

Look at this : https://postimg.cc/image/5ie55qiuf/. The command like that

– Success Man – 2018-09-05T01:02:42.947

The shortcut tab like this : https://postimg.cc/image/uof3csx1z/

– Success Man – 2018-09-05T01:06:24.687

It looks like you have a shortcut to the SSH Client application only. It looks like it's loading the most recently used profile on startup. Create a batch file with contents similar to what I showed, and make a Startup shortcut to that, instead of to the application. – David Yaw – 2018-09-05T04:48:54.220

-2

You can use plink command-line tool from PuTTY package. And make it start with Windows.

Martin Prikryl

Posted 2018-08-29T12:54:05.490

Reputation: 13 764

Means it can't use bitvise? – Success Man – 2018-08-29T22:10:44.320

I read here : https://superuser.com/questions/235395/automatic-ssh-tunneling-from-windows. Seems it can use bitvise. But there is no explanation where to set it

– Success Man – 2018-08-29T22:19:26.933

I didn't wrote that you cannot use Bitvise. I'm just not familiar with Bitvise. And it can be achieved with PuTTY/Plink. – Martin Prikryl – 2018-08-30T05:49:49.467

1I had read it. But i'm still confused. I need more detailed answers – Success Man – 2018-09-01T04:01:40.693

So tell us what details you need. We cannot know what you are confused about. – Martin Prikryl – 2018-09-01T05:08:00.893

What application needs to be installed? What are the steps to run it? – Success Man – 2018-09-01T05:36:55.417

Install PuTTY (plink comes with it). Command to run it is in the linked question. – Martin Prikryl – 2018-09-01T07:34:18.367

I had install putty in my windows. So, then I must intall plink.exe from here : https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html ?

– Success Man – 2018-09-01T09:05:26.237

Then you already have Plink.exe in C:\Program Files (x86)\PuTTY\plink.exe. – Martin Prikryl – 2018-09-01T09:06:00.243

There exist plink.exe. So I don't need to install plink.exe anymore – Success Man – 2018-09-01T09:37:32.077

And then what I run plink.exe -N -L localhost:5006:localhost:5006 user@remote.host in the commmand prompt? – Success Man – 2018-09-01T09:42:05.327

Yes, for a testing. But then you really want to add that to a scheduled task or shell:startup folder, as shown in https://superuser.com/q/954950/213663.

– Martin Prikryl – 2018-09-02T19:26:12.257