diff --git a/perl-xCAT/xCAT/RSYNC.pm b/perl-xCAT/xCAT/RSYNC.pm index d36694cf0..ba8209929 100644 --- a/perl-xCAT/xCAT/RSYNC.pm +++ b/perl-xCAT/xCAT/RSYNC.pm @@ -151,7 +151,7 @@ sub remote_copy_command or die "Can not open file $rsyncfile"; my $dest_dir_list = join ' ', keys %{ $$config{'destDir_srcFile'} }; my $dest_user_host = $$config{'dest-host'}; - if ($$config{'dest-user'}) + if (getpwnam($$config{'dest-user'})) { $dest_user_host = "$$config{'dest-user'}@" . "$$config{'dest-host'}"; diff --git a/perl-xCAT/xCAT/SSH.pm b/perl-xCAT/xCAT/SSH.pm index f7b70fff1..f146db1d1 100644 --- a/perl-xCAT/xCAT/SSH.pm +++ b/perl-xCAT/xCAT/SSH.pm @@ -150,7 +150,7 @@ sub remote_copy_command { open SCPCMDFILE, "> $scpfile" or die "Can not open file $scpfile"; - if ($$config{'dest-user'}) + if (getpwnam($$config{'dest-user'})) { $dest_user_host = "$$config{'dest-user'}@" . "$$config{'dest-host'}";