I have created two LXC containers on my host Ubuntu 16.0.4 one is Ubuntu and the other is Centos7 .I am trying to copy file from Centos7 using scp command to Ubuntu as root user it is asking for root password while I entered correct password it’s showing permission denied.May I know the possible reason why I am getting denied?
-
Do you have SELinux running on the host?Raman Sailopal– Raman Sailopal2017-10-04 09:35:35 +00:00Commented Oct 4, 2017 at 9:35
-
1Can root usually SSH to that host?Kusalananda– Kusalananda ♦2017-10-04 09:40:19 +00:00Commented Oct 4, 2017 at 9:40
-
@Kusalananda no I can’t it’s also same getting permission deniednaveen8577– naveen85772017-10-04 09:47:16 +00:00Commented Oct 4, 2017 at 9:47
-
@RamanSailopal SElinux is disabled in Centos7naveen8577– naveen85772017-10-04 09:47:50 +00:00Commented Oct 4, 2017 at 9:47
-
How are you running the containers? nspawn?Raman Sailopal– Raman Sailopal2017-10-04 09:54:42 +00:00Commented Oct 4, 2017 at 9:54
|
Show 3 more comments
1 Answer
By allowing the root in /etc/ssh/sshd_config (PermitRootLogin Yes), I was able to login.
according to man sshd_config
PermitRootLogin Specifies whether root can log in using ssh(1). The argument must be “yes”, “prohibit-password”, “without-password”, “forced-commands-only”, or “no”. The default is “prohibit-password”.
note that sshd must be restarted after a change in sshd_config.