Do you mean you cannot use ssh/sftp by logging in with user root at the server-end, but can as a regular user? In that case it's probably the server-end (where sshd is running) that restricts it.
It's not wise to run ssh/sftp as root, it's risky, and you should find another way of achieving your task, but here's something to try if you do want to use root account (read: log in to the other machine over ssh/sftp as root).
We'll do this thing on the server-end, the machine where ssh daemon (sshd) is running. One thing which tells to prevent logging in as root over ssh (sftp too) is sshd's configuration file. Check
/etc/ssh/sshd_config for a line that talks about
PermitRootLogin:
Code:
grep Root /etc/ssh/sshd_config
I think it's by default, or should be, like this:
That denies any connection that tries to give root as username. To let root log in over ssh/sftp, change that to
Code:
PermitRootLogin yes
by running a text-editor of your choice and editing the appropriate line. For this you obviously need privileges on the server-end to alter the file; possibly root privileges. Like I said, it's not a wise thing to do. After this you probably have to restart ssh service; on most distributions you'll achieve it by running this as root:
Code:
/etc/init.d/ssh restart
Then try again logging in.