?
Solved

Ubuntu 10.10 Enable Root User

Posted on 2012-09-10
5
Medium Priority
?
770 Views
Last Modified: 2012-09-24
I need to enable the root user for SSH in Ubuntu.  How do i do this?
0
Comment
Question by:deklinm
5 Comments
 
LVL 88

Accepted Solution

by:
rindi earned 668 total points
ID: 38383157
I strongly advise not to do that. You can always use sudo to perform tasks as root once you have ssh'd to Ubuntu using a normal user account. SSH'ing as root opens up points of attack and is a security risk.
0
 

Author Comment

by:deklinm
ID: 38383164
its a dev box.
0
 
LVL 8

Assisted Solution

by:Sumit Gupta
Sumit Gupta earned 668 total points
ID: 38383179
Basic SSH Setup On Ubuntu 10.04 Lucid Lynx Using OpenSSH Server

One of Linux’s more useful features is its ability to permit secure, encrypted remote access. Secure Shell technology (SSH) permits you to control a remote computer without having actual physical access to the machine. SSH’s network traffic is encrypted, and assuming you configure SSH correctly, quite secure.  Ubuntu Linux has always had strong support for SSH, and Lucid Lynx 10.04 is no different. You can use an SSH implementation called OpenSSH Server to remotely, securely access your machine.

Here’s how to install and perform a basic security configuration of OpenSSH Server on Ubuntu 10.04 Lucid Lynx.

First, you’ll need to install OpenSSH Server. To do so, open up a Terminal window and type the following command:

sudo apt-get install openssh-server

apt-get will then download and install OpenSSH Server. Depending upon the speed of your computer and Internet connection, the installation may take several minutes.

Once the installation has finished, return to the Terminal. We’ll need to make a few changes to your /etc/ssh/sshd_config file in order to increase SSH’s security. First, however, we’ll want to make a backup copy of your sshd_config file in case anything goes wrong. Type this command into the Terminal:

sudo cp /etc/ssh/sshd_config ~

This will make a backup copy of the sshd_config file in your home directory.

Next, we’ll need to edit the sshd_config file itself:

sudo gedit /etc/ssh/sshd_config

(Obviously you can use vi or emacs or the editor of your choice instead, though newer Linux users tend to find gedit’s GUI easier to use.)

Once you’re editing the file, you’ll want to add the following two directives to the end of the file:

PermitRootLogin yes

AllowUsers USERNAME

PermitRootLogin no will block root from logging in via SSH. It’s best to never enable root SSH access, since if an attacker happens to figure out the root password, he or she will have total remote control over your system.

AllowUsers adds an additional layer of protection by only allowing specific users to connect via SSH. For instance, if you wanted only users test1 and test2 to have SSH access, you would set AllowUsers as AllowUsers test1 test2.

You may also want to consider changing the Ports directive. By default SSH runs over TCP/IP port 22, which means that any malware bot autoscanning port 22 can target it. Changing the Ports directive to something different will make SSH run over a different, blocking some of those automated cracking attempts.

Once you have finished changing your settings, save the sshd_config file, and restart the SSH daemon with this command:

sudo /etc/init.d/ssh restart

You should now be able to SSH into your Ubuntu Lucid Lynx machine from another system with an SSH client.
0
 
LVL 88

Expert Comment

by:rindi
ID: 38383205
So what? Whether it's a Dev box or not shouldn't make any difference.
0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 664 total points
ID: 38383214
While I agree with Rindi, here's some detail to allow or deny users to ssh on Ubuntu

https://help.ubuntu.com/community/SSH/OpenSSH/Configuring
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month15 days, 11 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question