SSH
From Apis Networks Wiki
Contents |
Overview
Shell access is available for accounts of the Basic tier and higher.
Important: Do not use the shell for IRC access, BitTorrents, or dedicated services. Failure to comply with those restrictions may result in an account cancellation.
Usage
Logging In
user@domain. If your client does not properly interpret @ as part of the login, then you may swap @ with #. Logins should always be provided in lowercase. Unless you have made custom modifications to your DNS records the hostname/server name will always be your domain name. You may use any secondary domain attached to your hosting account listed in Multiple Domain Manager.
Using a text-based ssh client, you would use ssh username#yourdomain.com@yourdomain.com or equivalently, ssh -l username@yourdomain.com yourdomain.com
ssh username@yourdomain.com is incorrect.
Running Daemons
We allow users to run services on their hosting account under three conditions:
- Outbound bandwidth originating from the service is marginal (< 1 GB/month)
- Memory footprint/CPU is small -- this is handled on a case-by-case basis. Under 24 MB memory usage is permitted. CPU is case-by-case
- TCP/UDP ports are within your reserved port range ([4xxx0,4xxx9])
Services that may be used for backend purposes such as memcached are recommended to use a socket instead of port. Sockets are local to the filesystem and do not occupy one of the 10 reserved ports for TCP/UDP communication.
Changing the home directory
If you'd like to change change the default directory that you login to edit the file called .bashrc in your home directory - /home/user. You may change the HOME environment variable, but it will be canceled out. Simple change the directory to where you'd like to be. For example from /home/example_user to /var/www:
# .bashrc example file cd /var/www
Questions
Which forms of SSH are allowed?
Only SSHv2 may be used to connect to the server on port 22.
Troubleshooting
OpenSSH truncates usernames to 30 characters
When attempting to connect via the ssh command-line utility, certain users may see their logins truncated to 30 characters. For example, the command may resemble something similar to this:
ssh -l abcdefghijklmnopqrstuvwxyz@abcdef.com abcdef.com # Server Output: # abcdefghijklmnopqrstuvwxyz@abc@abcdef.coms password:
This is benign and due to how OpenSSH formats its prompt. Output is truncated to 30 characters, likely for display reasons:
if (attempt != 1)
error("Permission denied, please try again.");
snprintf(prompt, sizeof(prompt), "%.30s@%.128s's password: ",
authctxt->server_user, authctxt->host);
Your login will still succeed provided SSH support is included.
My keys are setup, but I still cannot authenticate with public keys
Ensure the permissions on ~/.ssh/ are 700 (u: rwx, g: -, o: -) and ~/.ssh/authorized_keys is 600 (u: rw-, g: -, o: -). Provided the permissions are correct, then make sure your public key is listed in the authorized_keys file.
