Creating a Shell Server

From SHellium Wiki
Jump to: navigation, search
Geographylogo.png In other languages: English | Afrikaans | Albanian | Arabic | Brazilian | Bulgarian | Catalan | Chinese | Croatian | Czech | Danish | Dutch | Esperanto | Estonian | Filipino | Finnish | Flemish | French | German | Greek | Hebrew | Hindi | Hungarian | Indonesian | Italian | Japanese | Latvian | Lithuanian | Macedonian | Malay | Malayalam | Norwegian (Bokmål) | Norwegian (Nynorsk) | Persian | Polish | Portuguese | Romanian | Russian | Serbian | Slovak | Slovenian | Spanish | Swedish | Turkish | Ukrainian | Urdu

Contents

Debian/Ubuntu

sudo apt-get install openssh-server

If you don't have the ssh client installed, you'll have to get that too.

sudo apt-get install ssh

Other

Find and install a package called sshd, ssh-server. or similar.

Usage

By default, the ssh daemon will open port 22 for users to connect to your computer. If you wish to change the port to something more accessible, (or something that won't get hit by scripts all day long), change the file /etc/ssh/sshd_config (this may be different on distros other than Debian based ones).

vim /etc/ssh/sshd_config

or

nano /etc/ssh/sshd_config

or whatever other editor you have

Change the line that says:

Port 22

To something more accessible, like:

Port 443

or

Port 37890 # if you really must :S

Next set

ServerKeyBits 768

to

ServerKeyBits 2056

for a bigger key making it harder to crack.

Also change

PermitRootLogin yes 

to

PermitRootLogin no

WARNING: do NOT do the above setting on ubuntu, you will lose your login privileges as normal user (since you're a member of the admin group). This works fine on Debian and is highly recommended. All this does is blocks people from logging in with the root account. You can always su to root once your in though.

Set

PermitEmptyPasswords yes

to

PermitEmptyPasswords no

After all these settings you should restart the ssh daemon

On Ubuntu (for debian don't sudo use su)

sudo /etc/init.d/ssh restart

Allowing incoming connections

To allow the outside world to connect to your server:

1. Add an exception in your firewall rules to allow the port you have specified. (iptables, firestarter etc)

2. Forward the port in your router to your computer.

Finished.

Personal tools
Namespaces

Variants
Actions
Navigation
Indexes
SHellium Sites
Toolbox