More
referral
Increase your income with Hive. Invite your friends and earn real cryptocurrency!

Set up HiveOS remote shell session automatically

It’s possible to set up a remote shell session by clicking on “Hive Shell Start”. However, this needs to be done every time HiveOS reboots. In addition to that, the ssh string is not very memorable and changes every single time.

Is there a way to make the remote session start every time on boot, and also have some reasonable name which is the same every time? That way I can SSH using my terminal client without having to go to the web version of hiveos first and mess around with ah bunch of stuff and copy the ssh address every single time.

This is a very bad idea in every sense.
If you really need it, then configure OpenVPN.

Why? is it worse than starting it manually every time my rig starts? lol. I have access to my university’s supercomputer, and they do it exactly like this. Are you saying my university’s supercomputer cluster also has shitty security? honestly don’t get what you’re trying to say

Hive Shell is at least not what you are looking for.
Session depends of activity and limited to 1h.
You can do with university computer whatever to do and with your rig(s) too just setup VPN as I suggest before.

Not really sure what you mean. I’m using a VPN with Mullvad’s OpenVPN configuration. Are you saying that I can ssh in with that?

Here изображение

This is what I see, so I’m not sure how to ssh into it

It’s setup section
When it will be finished you will see on your dashboard something like this
изображение

Thanks! What command do I use then, with this IP address? Don’t I need a username as well? Like ssh username@ipaddress?

CamoKing, treat HiveOS just like you would any other linux install. If you are trying to ssh to your rig from the same network i.e. your home network just use ssh user@IP_addres and the password will be whatever you set it to when configuring or 1 which is the default.

Frankly, I completely disagree with HaloGenius on the security of using ssh. HiveOS is currently configured to start sshd on boot so that HiveShell can work. A command is sent to the rig to create a tunnel back to Hiveos.farm to present a web accessible shell. That’s all well and good if you are working remotely from different networks but if you are in the same network across the room or the house or office then utilizing a direct ssh connection precludes anything going out and frankly I would never want to use a web service that provides ssh connectivity back to my internal network. That can create a “Man in the middle” situation.

The other thing that occurs is when you login as user the final command as user given within .profile is to switch users to root. This has got to be one of the most insecure actions to take and the use of sudo should be promoted instead.

My suggestion is to use hive-passwd and change your password to something highly secure like a 12 character or greater password with upper and lower, numbers and symbols.

Look up how to create secure ssh keys and use them with an ssh-agent for linux or pageant for putty

One caveat to setting up the keys is I don’t know if the /home/user directory is overwritten in an upgrade.

1 Like

I don’t say about ssh that it’s no secure. Don’t twist my words!
Hive Shell doesn’t use sshd daemon at all LOL
Using Hive Shell at startup useless because it’s not VPN session with a constant connection. It’s a session on-demand with time-limited period to 1h. So what is sense create it on boot? For this there is OpenVPN.

Ok, I retract that one statement, it is not what you said and if you feel the OP’s question is about connecting from offsite via your website to his rig then I agree establishing a semi-perm connection via ssh on the website is a bad idea.

On the other hand if his question is about connecting to his rig from across the room or building but still within the same subnet or behind a common firewall then ssh is a perfectly fine thing to do and I see no reason to use something like HiveShell or any of the other remote connection capabilities provided within the Web interface including OpenVPN.

As for how Hive Shell operates, I took the time to dive into it and stopped before decompiling hssh because I think I have figured it out. My steps may be slightly out of order but the gist of it is the following:

  1. The Hive agent does a very frequent polling of the HiveOS farm API (I think it is like every 10 secs based upon what I saw and the logs)
  2. If the agent receives a command like to open a Hive Shell via the API polling it then executes said command and in this case it looks like it is hssh
  3. I think hssh establishes a connection to Shellinabox and then opens tmate with that connection and connects back to HiveOs.farm which is then presented to the user

My point still remains that on a local network there is no need for the Hive Shell as the SSHD is running by default and in the process of looking deeper Shell in a Box is also running and can be accessed on the local network by pointing a browser at IP_Address:4200 (IP_Address being the address of your rig).

Did I get it correct now?

On local network user can use ShellInAbox via web interface and as is SSH on standard port 22 via classical ssh clients (PuTTY for example). This also true if OpenVPN up.
Of course there is also possible access via ssh + NAT.
And “yes” Hive Shell can work on LAN too but it’s non effective usage because will be used Hive server as dealer.

It is already there. If you log into the rig through the standard shell version. You can run a command: adduser. This will add the user with username, password and similar.

You can then find the IP og the rig in the overview section of your worker gui. Putty works great.

If you need root access you can go to edit /etc/sudoers file. Chis is a file that is read only, so you need give write. Update it with your user. Then change back to read only for security reasons.

However! make sure you really want to open your rigg for the net. Someone could steal your mining power or similar. At least make a very strong password!!! (sentence to chars or similar with numbers and special chars)

Thank you for the advice! I have no problem opening it up to the internet because I can use a long random password which I can save to my other local machine to SSH in. However, when I run the adduser command, I get the following message:

adduser: Only one or two names allowed.

Any ideas?

Hey, thank you very much for taking the time to look into this! I really appreciate it. I wasn’t sure if this comment was directed to me or the other guy, but I wanted to say that I’m not quite sure how to ssh in with the IP address. I tried doing ip:4200 in my browser, but it didn’t seem to work.

Sorry, I just read this. So I tried ssh root@ip where ip is the address of my rig. It actually seemed to be doing something, but it asked me for the password of the root user. I don’t recall setting any password. I tried 1 as the password as you suggested, but it didn’t seem to work. Any other suggestions that you might have?

Actually I managed to do something. I did adduser guest and added a password. Then I was able to ssh guest@ip where ip is the IP address for hiveos, and it worked.

However, when I ssh in, I get a really basic prompt which looks nothing like the normal access. Even when I type in miner to see my miner, it tells me

There is no screen to be attached matching miner.

This seems to imply that I am unable to view anything of importance unless I ssh in as the root user. I will try to see if I can do that.

I just tried setting the root user’s password using an online tutorial (using the passwd command) but when I try to ssh in with ssh root@ip I keep getting an error which says

Permission denied, please try again.

and on the third attempt

Permission denied (publickey,password).

even though I’m sure I’m using the right password.

You have to be super user. To do this you must add your name to sudo users in /etc/sudousers file. Chage it from read only and then edit it.

Then you should be able to use “sudo -i” to get root shell or you can use “sudo miner” and similar commands like “sudo miner start”.

1 Like