How to configure SFTP to login in the "/" directory?

45,391

Warning: This method might be unsafe for server users.

Ubuntu doesn't allow root user and also login in ssh as root by default.

So the first thing you have to do is to enable your root user account:

$ sudo passwd root

Now you have got your root account enabled now.

I am not sure whether you have installed your OpenSSH server or not.

So I will teach you how to install OpenSSH server.

$ sudo apt-get install openssh-server

Now you are able to edit the ssh config:

$ sudo vi /etc/ssh/sshd_config

Find the line contains "PermitRootLogin no", modify it to "PermitRootLogin yes".

Oh yeah, now restart the ssh server:

$ sudo service ssh restart

Now give it a try

Share:
45,391

Related videos on Youtube

Nabil
Author by

Nabil

Updated on September 18, 2022

Comments

  • Nabil
    Nabil almost 2 years

    I want to login as root and make the / as the default directory in SFTP. Newbie help needed

    • Rinzwind
      Rinzwind over 10 years
      As a friendly advice from a more experienced user: please don't and follow the standard method. It is proven to work and it is secure. You can use this as a reference: en.wikibooks.org/wiki/OpenSSH/Cookbook/SFTP
  • Nabil
    Nabil over 10 years
    Thanks. I edited the /etc/passwd file to change the root's home directory..
  • z8r0
    z8r0 over 10 years
    every road leads to rome,right?
  • Jastria Rahmat
    Jastria Rahmat over 4 years
    I can confirm this works. but in my opinion, yes it is unsafe