
lucacalcaterra/wettyyum install sshpass (red hat flavours eg. CentOs)Wettu can either be run as a standalone service or from another node script. To see how to use WeTTy from node see the API Doc
bash$ node index.js
Open your browser on [***] and you will prompted to
login. Or go to [***]<username> to specify the
user before hand.
If you run it as root it will launch /bin/login (where you can specify the
user name), else it will launch ssh and connect by default to localhost.
If instead you wish to connect to a remote host you can specify the --sshhost
option, the SSH port using the --sshport option and the SSH user using the
--sshuser option.
WeTTy can be run with the --help flag to get a full list of flags.
WeTTy runs on port 3000 by default. You can change the default port by
starting with the --port or -p flag.
If WeTTy is run as root while the host is set as the local machine it will use
the login binary rather than ssh. If no host is specified it will use
localhost as the ssh host.
If instead you wish to connect to a remote host you can specify the host with
the --sshhost flag and pass the IP or DNS address of the host you want to
connect to.
You can specify the default user used to ssh to a host using the --sshuser.
This user can overwritten by going to [***]<username>.
If this is left blank a user will be prompted to enter their username when they
connect.
By default WeTTy will try to ssh to port 22, if your host uses an alternative
ssh port this can be specified with the flag --sshport.
If you'd prefer an HTTP base prefix other than /wetty, you can specify that
with --base.
Do not set this to /ssh/${something}, as this will break username matching
code.
Always use HTTPS especially with a terminal to your server. You can add HTTPS by either using WeTTy behind a proxy or directly.
To run WeTTy directly with ssl use both the --sslkey and --sslcert flags and
pass them the path too your cert and key as follows:
bashnode index.js --sslkey key.pem --sslcert cert.pem
If you don't have SSL certificates from a CA you can create a self signed certificate using this command:
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 30000 -nodes
You can also pass the ssh password as an optional query parameter to auto-login the user like this (Only while running wetty as a non root account):
[***]<username>?sshpass=<password>
This is not a required feature and the security implications for passing the password in the url will have to be ***ed by the user
As said earlier you can use a proxy to add https to WeTTy.
Note that if your proxy is configured for https you should run WeTTy without SSL
If your proxy uses a base path other than /wetty, specify the path with the
--base flag, or the BASE environment variable.
For a more detailed look see the nginx.conf used for testing
Put the following configuration in nginx's conf:
nginxlocation /wetty { proxy_pass [***] proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_read_timeout 43200000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; }
Put the following configuration in apache's conf:
apacheRewriteCond %{REQUEST_URI} ^/wetty/socket.io [NC] RewriteCond %{QUERY_STRING} transport=websocket [NC] RewriteRule /wetty/socket.io/(.*) ws://localhost:3000/wetty/socket.io/$1 [P,L] <LocationMatch ^/wetty/(.*)> DirectorySlash On Require all granted ProxyPassMatch [***] ProxyPassReverse /wetty/ </LocationMatch>
WeTTy can be run from a container to ssh to a remote host or the host system.
This is handy for quick deployments. Just modify docker-compose.yml for your
host and run:
sh$ docker-compose up -d
Visit the appropriate URL in your browser
([localhost|$(boot2docker ip)]:PORT).
The default username is term and the password is term, if you did not modify
SSHHOST
In the docker version all flags can be accessed as environment variables such as
SSHHOST or SSHPORT.
If you dont want to build the image yourself just remove the line build; .
bash$ sudo yarn global add wetty.js $ sudo cp ~/.config/yarn/global/node_modules/wetty.js/bin/wetty.conf /etc/init $ sudo start wetty
bash$ yarn global add wetty.js $ cp ~/.config/yarn/global/node_modules/wetty.js/bin/wetty.service ~/.config/systemd/user/ $ systemctl --user enable wetty $ systemctl --user start wetty
This will start WeTTy on port 3000. If you want to change the port or redirect
stdout/stderr you should change the last line in wetty.conf file, something
like this:
systemdexec sudo -u root wetty -p 80 >> /var/log/wetty.log 2>&1
WeTTy supports all browsers that xterm.js supports.






manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务