x
Loading
 Loading
Hello, Guest | Login | Register

Mastering Root Logins, Selectively Blocking Server Access, Preventing a bash History

My server will not let me ssh in as root, but I need to copy over files while preserving ownerships and permissions. Can I still do this?

1

My server will not let me ssh in as root, but I need to copy over files while preserving ownerships and permissions. Can I still do this?

Absolutely. Many ssh installations default to disallowing ssh logins as root for security reasons. (Actually, most inetd installations restrict this also, which generally restricts root from remote ftp, telnet, and other inetd-started services.)

However, you can copy files while preserving permissions without scping as root. The simplest way to do this is with the tar command. If you run the command as root, tar should default to preserving ownerships and permissions of archived files. Create and extract the tar file as root and copy it over as any user.

You may also allow root logins over ssh. The sshd daemon is generally configured by editing the file /etc/ssh/ sshd_config. There is a configuration directive named PermitRootLogin that defaults to No in many installations. Changing this to Yes allows root logins via ssh.

Many system administrators will want to limit the typing of the root password as much as possible, including root logins. Even though sshd encrypts all transmission, there are very good reasons to avoid logging in as the superuser.

You can avoid root logins altogether by continuing to deny remote (telnet, ftp, ssh) root authentication and using the sudo program to gain shells with superuser privileges. sudo allows certain users to run specified programs as root….

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Power Up Linux GUI Apps
  2. Tweeting from the Command Line with Twyt
  3. When Memory Serves You: Using ramfs and tmpfs
  4. Disk-O-Tech: Linux Disk Management
  5. Bang for the Buck
Follow Linux Magazine
Rackspace