Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request - Allow change of default host #94

Closed
shinji257 opened this issue Mar 21, 2012 · 4 comments
Closed

Request - Allow change of default host #94

shinji257 opened this issue Mar 21, 2012 · 4 comments

Comments

@shinji257
Copy link

When authenticated the default host of the session is localhost. Can we get an option to customize it to point somewhere else or even to leave it blank? If it is blank it would require it to be populated by simply looping back to the prompt when it is empty.

@liftoff
Copy link
Owner

liftoff commented Mar 21, 2012

This is a great idea! You can expect this feature in the next commit.

@liftoff
Copy link
Owner

liftoff commented Mar 21, 2012

I just pushed a commit that adds this feature. To enable it you just need to add "--default_host='yourhostname'" to the 'command' in your server.conf:

command = "/opt/gateone/plugins/ssh/scripts/ssh_connect.py --default_host='somehost' --logo -S '/tmp/gateone/%SESSION%/%SHORT_SOCKET%' --sshfp -a '-oUserKnownHostsFile=%USERDIR%/%USER%/ssh/known_hosts'"

That will make the prompt look like so:

[Press Shift-F1 for help]                                                                                                                                                                                                                

Host/IP or SSH URL [somehost]:

If you want to disable the default host altogether just set default_host equal to an empty string like so:

command = "/opt/gateone/plugins/ssh/scripts/ssh_connect.py --default_host='' --logo -S '/tmp/gateone/%SESSION%/%SHORT_SOCKET%' --sshfp -a '-oUserKnownHostsFile=%USERDIR%/%USER%/ssh/known_hosts'"

Give it a try and let me know how it goes. Thanks!

@shinji257
Copy link
Author

That seems to work great. I set it to not have a default host and it omitted it as expected and also errored indicating it needed a valid one which was also what I wanted. Thanks!

@liftoff
Copy link
Owner

liftoff commented Mar 22, 2012

Great! I'm going to close out this issue then. Please open more tickets for more features like this! I love the easy ones :)

@liftoff liftoff closed this as completed Mar 22, 2012
pauldorn pushed a commit to pauldorn/GateOne that referenced this issue Sep 22, 2015
utils.py:  Added drop_privileges() so we can run as a user/group other than root.
gateone.py:  Gate One now supports --uid and --gid to enable dropping of privileges.  These two options can take a string or an integer (e.g. 'gateone' or '1005' will work).  This means that if you run Gate One as root it will open the listening port (e.g. 443) and then drop to the given user/group.  It automatically tries to fix the permissions of writable directories (user_dir, session_dir, logs, etc) and does its best to figure out what supplemental group owns /dev/pts so it can be added to the executing supplemental groups.
gateone.py:  Many directories that were previously created with chmod 0700 are now being created using 0770 (in case someone wants to manage access based on the owning group).
gateone.py:  Added two new plugin hooks that allow arbitrary code to be placed in the header and body of index.html.  This is primarily to make it easier for plugins to include 3rd party JavaScript libraries but it should also be an all-around useful feature.
ssh_connect.py:  Added the ability to specify a default_host for all connections.  This will allow you to have something other than [localhost] in the SSH connection prompt.  Also, if you pass this option an empty string (--default_host="") it will force the user to enter a valid hostname (i.e. no default).  This should take care of the following feature request:  liftoff#94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants