Safely granting permission to a Perl script to change users and groups of filed downloaded with rsync
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I've got a Perl script which is a wrapper to a Net::OpenSSH
object which I use to rsync
a remote server's files to my local machine. I'm using the archive, -a
, option to preserve file ownership and permission. When I download the files, however, the user and owner is set to my local user and group, not the user and group of the files on the server.
I changed the group of my script to admin
which can run all commands with no password. But this didn't work.
Is there a way to do this securely without having to enter a password?
permissions scripting rsync perl
add a comment |Â
up vote
0
down vote
favorite
I've got a Perl script which is a wrapper to a Net::OpenSSH
object which I use to rsync
a remote server's files to my local machine. I'm using the archive, -a
, option to preserve file ownership and permission. When I download the files, however, the user and owner is set to my local user and group, not the user and group of the files on the server.
I changed the group of my script to admin
which can run all commands with no password. But this didn't work.
Is there a way to do this securely without having to enter a password?
permissions scripting rsync perl
2
You're basically asking how to grant the script super user privileges without asking for a password? Running the script using sudo would do that. If that is secure or not depends on the script and the user using it.
â Kusalananda
Jan 22 at 13:34
You can do part of what you're asking with sudo. You can limit a user to being able to only use the command useradd. However your problem is probably bigger. Linux doesn't by default use ACLs and it just uses a user id and group id that is not random ids are just created in order. This means this id is likely to map from the old systems first user to the new systems first user and so on.
â jdwolf
Jan 22 at 13:44
The problem is if I run as sudo, it won't be able to find my locally installed perl library.
â StevieD
Jan 22 at 13:44
@StevieD Run sudo with the -E option.
â jdwolf
Jan 22 at 13:45
Thanks but still got perl errors with-E
. It can't find the necessary modules.
â StevieD
Jan 22 at 13:50
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I've got a Perl script which is a wrapper to a Net::OpenSSH
object which I use to rsync
a remote server's files to my local machine. I'm using the archive, -a
, option to preserve file ownership and permission. When I download the files, however, the user and owner is set to my local user and group, not the user and group of the files on the server.
I changed the group of my script to admin
which can run all commands with no password. But this didn't work.
Is there a way to do this securely without having to enter a password?
permissions scripting rsync perl
I've got a Perl script which is a wrapper to a Net::OpenSSH
object which I use to rsync
a remote server's files to my local machine. I'm using the archive, -a
, option to preserve file ownership and permission. When I download the files, however, the user and owner is set to my local user and group, not the user and group of the files on the server.
I changed the group of my script to admin
which can run all commands with no password. But this didn't work.
Is there a way to do this securely without having to enter a password?
permissions scripting rsync perl
asked Jan 22 at 13:30
StevieD
1507
1507
2
You're basically asking how to grant the script super user privileges without asking for a password? Running the script using sudo would do that. If that is secure or not depends on the script and the user using it.
â Kusalananda
Jan 22 at 13:34
You can do part of what you're asking with sudo. You can limit a user to being able to only use the command useradd. However your problem is probably bigger. Linux doesn't by default use ACLs and it just uses a user id and group id that is not random ids are just created in order. This means this id is likely to map from the old systems first user to the new systems first user and so on.
â jdwolf
Jan 22 at 13:44
The problem is if I run as sudo, it won't be able to find my locally installed perl library.
â StevieD
Jan 22 at 13:44
@StevieD Run sudo with the -E option.
â jdwolf
Jan 22 at 13:45
Thanks but still got perl errors with-E
. It can't find the necessary modules.
â StevieD
Jan 22 at 13:50
add a comment |Â
2
You're basically asking how to grant the script super user privileges without asking for a password? Running the script using sudo would do that. If that is secure or not depends on the script and the user using it.
â Kusalananda
Jan 22 at 13:34
You can do part of what you're asking with sudo. You can limit a user to being able to only use the command useradd. However your problem is probably bigger. Linux doesn't by default use ACLs and it just uses a user id and group id that is not random ids are just created in order. This means this id is likely to map from the old systems first user to the new systems first user and so on.
â jdwolf
Jan 22 at 13:44
The problem is if I run as sudo, it won't be able to find my locally installed perl library.
â StevieD
Jan 22 at 13:44
@StevieD Run sudo with the -E option.
â jdwolf
Jan 22 at 13:45
Thanks but still got perl errors with-E
. It can't find the necessary modules.
â StevieD
Jan 22 at 13:50
2
2
You're basically asking how to grant the script super user privileges without asking for a password? Running the script using sudo would do that. If that is secure or not depends on the script and the user using it.
â Kusalananda
Jan 22 at 13:34
You're basically asking how to grant the script super user privileges without asking for a password? Running the script using sudo would do that. If that is secure or not depends on the script and the user using it.
â Kusalananda
Jan 22 at 13:34
You can do part of what you're asking with sudo. You can limit a user to being able to only use the command useradd. However your problem is probably bigger. Linux doesn't by default use ACLs and it just uses a user id and group id that is not random ids are just created in order. This means this id is likely to map from the old systems first user to the new systems first user and so on.
â jdwolf
Jan 22 at 13:44
You can do part of what you're asking with sudo. You can limit a user to being able to only use the command useradd. However your problem is probably bigger. Linux doesn't by default use ACLs and it just uses a user id and group id that is not random ids are just created in order. This means this id is likely to map from the old systems first user to the new systems first user and so on.
â jdwolf
Jan 22 at 13:44
The problem is if I run as sudo, it won't be able to find my locally installed perl library.
â StevieD
Jan 22 at 13:44
The problem is if I run as sudo, it won't be able to find my locally installed perl library.
â StevieD
Jan 22 at 13:44
@StevieD Run sudo with the -E option.
â jdwolf
Jan 22 at 13:45
@StevieD Run sudo with the -E option.
â jdwolf
Jan 22 at 13:45
Thanks but still got perl errors with
-E
. It can't find the necessary modules.â StevieD
Jan 22 at 13:50
Thanks but still got perl errors with
-E
. It can't find the necessary modules.â StevieD
Jan 22 at 13:50
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f418858%2fsafely-granting-permission-to-a-perl-script-to-change-users-and-groups-of-filed%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
You're basically asking how to grant the script super user privileges without asking for a password? Running the script using sudo would do that. If that is secure or not depends on the script and the user using it.
â Kusalananda
Jan 22 at 13:34
You can do part of what you're asking with sudo. You can limit a user to being able to only use the command useradd. However your problem is probably bigger. Linux doesn't by default use ACLs and it just uses a user id and group id that is not random ids are just created in order. This means this id is likely to map from the old systems first user to the new systems first user and so on.
â jdwolf
Jan 22 at 13:44
The problem is if I run as sudo, it won't be able to find my locally installed perl library.
â StevieD
Jan 22 at 13:44
@StevieD Run sudo with the -E option.
â jdwolf
Jan 22 at 13:45
Thanks but still got perl errors with
-E
. It can't find the necessary modules.â StevieD
Jan 22 at 13:50