Sections

  • About Author
  • Contact
  • Debian Hosting
  • Popular Posts
  • Privacy Policy
  • Sitemap

Debian Admin

Debian/Ubuntu Linux System Administration Tutorials,Howtos,Tips

Categories

  • Backup
  • Database
  • Free-Tools
  • General
  • Monitoring
  • Network
  • Other Linux
  • Package-Mgmt
  • Paloalto Firewalls
  • Security
  • Webserver

Administer Your Ubuntu Server Remotely

Posted on December 20, 2006 by ruchi 3 Comments

If you want to Administer Your Ubuntu Server Remotely in secure manner for your daily tasks or some maintenance for this you need to install SSH server.SSH provides you with the ability to remotely log in to your server and run commandsall over an encrypted channel. Plus, SSH offers a number of advanced functions that can make remote administration simpler.

Install SSH server in Ubuntu

sudo apt-get install openssh-server

This will complete the installation.the package will take care of creating the initial RSA and DSA keys you need, as well as providing you with a default SSH config.

Connecting to the server

Now you can connect to the server from other machines using the following command

ssh serveripaddress

Example

ssh 195.14.2.1

Configure SSH

The main configuration file located at /etc/ssh/sshd_config and the default configuration will enables remote root logins and X11 forwarding which is not good for your server security.So now we will disable these two options.

Disable remorte root logins

For this you need to search for the following line in /etc/ssh/sshd_config file

PermitRootLogin yes

and chnage this to the following one

PermitRootLogin no

Disable X11 forwarding

For this you need to search for the following line in /etc/ssh/sshd_config file

X11Forwarding yes

and chnage this to the following one

X11Forwarding no

After finishing your configuration you need to restart SSH server using the following command

sudo /etc/init.d/ssh restart

X11 Forwarding

If you want to use X11 Forwarding option so that you can connect your remote machine desktop using Xterm if you want to connect the X11 session you need to use the following command

ssh -X serveripaddress

Copy Files Securely using SCP

Another common need is to be able to copy files between servers you are administering. While you could set up FTP on all of the servers, this is a less-than-ideal and potentially insecure solution. SSH includes within it the capability to copy files using the scp command. This has the added benefit of copying the files over a secure channel along with taking advantage of any key-based authentication you might have already set up.

To copy a file to a remote machine use the following command

scp /path/to/file [email protected]:/path/to/destination

If you need to copy from the remote host to the local host, reverse the above command

scp [email protected]:/path/to/file /path/to/destination

if you need to copy an entire directory full of files to a remote location, use the -r argument

scp -r /path/to/directory/ [email protected]:/path/to/destination/

If you are transferring logfiles or other highly compressible files, you might benefit from the -C argument. This turns on compression, which, while it will increase the CPU usage during the copy, should also increase the speed in which the file transfers.

Use the -l argument to limit how much bandwidth is used. Follow -l with the bandwidth you want to use in kilobits per second. So, to transfer a file and limit it to 256 Kbps use the following command

scp -l 256 /path/to/file [email protected]:/path/to/destination

Sponsored Link

Related content:

  1. SSH your Debian servers without password
  2. Howto bind ssh to selected IP address
  3. Howto use SSH local and remote port forwarding
  4. Mount a remote file system through ssh Using sshfs
  5. Howto perform UDP tunneling through SSH connection

Categories: Other Linux

Tags: configuring-ssh-server-ubuntu, copy-files-securely-using-scp, disable-remote-root-account-in-ssh, disable-x11-forwarding-in-ssh-ubuntu, how-to-connect-x11-session-remotely, install-ssh-server-ubuntu, Other Linux, Security, server, ssh-examples

3 thoughts on “Administer Your Ubuntu Server Remotely”

  1. cande on October 22, 2011 at 3:47 pm said:

    thanx!

  2. peter drinnan on October 28, 2011 at 6:30 pm said:

    Probably a dumb question from me but is there a way to use the remote desktop similar to what you can do with Ubuntu desktop?

  3. ward on November 9, 2011 at 4:12 pm said:

    Peter,

    Do you mean rdesktop or VNC?

    Ward

Leave a comment

Your email address will not be published. Required fields are marked *

« Recover Data from a Damaged hard disk using dd_rhelp
Mount and Unmout ISO images without burning them »

Sponsored Link

    Cheap Web Hosting

Categories

  • Backup
  • Database
  • Free-Tools
  • General
  • Monitoring
  • Network
  • Other Linux
  • Package-Mgmt
  • Paloalto Firewalls
  • Security
  • Webserver

Sponsored Link

Archives

Sponsored Link

Favourite Sites

Ubuntu Geek
  • About Author
  • Contact
  • Debian Hosting
  • Popular Posts
  • Privacy Policy
  • Sitemap