Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 165555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:56:30+00:00 2026-05-11T11:56:30+00:00

Does SCP have a problem setting file permissions or have I misconfiguration my server?

  • 0

Does SCP have a problem setting file permissions or have I misconfiguration my server?

Use case:

There is a file on a server that I want to edit called "importantFile.txt". The file has owner and group of "master":

ls -l importantFile.txt: -rw-rw-r--  1 master master     7 Mar 18 08:11 importantFile.txt 

I am called "slave" but luckily, I am in group "master" so I can edit the file as I see fit. However, I’m a lazy slave and can’t be bothered to edit the file on the server, I’d prefer to edit the file on my local machine and SCP it to the server:

echo "bored slave info" > importantFile.txt scp importantFile.txt slave@theServerAddress:/pathToFile/importantFile.txt 

If I do this, the contents of the file on the server are uploaded fine and the timestamp of the file is updated but the permissions of the file don’t change, the file is still owned by "master". This is a problem because if "slave" uploaded bad content, no one would know it was "slave" who caused the problem, "master" would look guilty.

Perhaps I have to set a umask? if so where? I tried .bash_profile without success and haven’t found anything on Google about umask in /etc/ssh/sshd_config.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:56:30+00:00Added an answer on May 11, 2026 at 11:56 am

    That’s nothing special about scp – try logging on to the server as slave, and editing the file using your favourite text editor… You’ll find the same behaviour occurs… Writing to a file does not make you the owner of the file.


    Example:

    as root

    #cd /tmp #mkdir fubar #chgrp vboxusers fubar #cd fubar/ #touch testfile #chgrp vboxusers testfile  #chmod g+w . testfile #ls -al total 16 drwxrwxr-x  2 root vboxusers  4096 2009-03-19 10:30 . drwxrwxrwt 15 root root      12288 2009-03-19 10:29 .. -rw-rw-r--  1 root vboxusers     0 2009-03-19 10:30 testfile #echo foo > testfile  #ls -al total 20 drwxrwxr-x  2 root vboxusers  4096 2009-03-19 10:30 . drwxrwxrwt 15 root root      12288 2009-03-19 10:29 .. -rw-rw-r--  1 root vboxusers     4 2009-03-19 10:30 testfile 

    as user (in vboxusers group)

    >cd /tmp/fubar >ls -al total 20 drwxrwxr-x  2 root vboxusers  4096 2009-03-19 10:30 . drwxrwxrwt 15 root root      12288 2009-03-19 10:29 .. -rw-rw-r--  1 root vboxusers     4 2009-03-19 10:30 testfile >echo bar >> testfile  >ls -al total 20 drwxrwxr-x  2 root vboxusers  4096 2009-03-19 10:30 . drwxrwxrwt 15 root root      12288 2009-03-19 10:29 .. -rw-rw-r--  1 root vboxusers     8 2009-03-19 10:31 testfile >vim testfile >ls -al total 20 drwxrwxr-x  2 root vboxusers  4096 2009-03-19 10:31 . drwxrwxrwt 15 root root      12288 2009-03-19 10:31 .. -rw-rw-r--  1 root vboxusers    12 2009-03-19 10:31 testfile >cat testfile  foo bar baz 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone use have a good regex library that they like to use? Most
Does anyone have any recommendations of tools that can be of assistance with moving
Does anyone have a definitive answer to whether Sql Server Management Objects is compatible
I have 17 gigs of images directly on my server that I would like
I am writing a script that will transfer a file from one server to
Does anyone out there know if it is possible to use sharding with a
Does Google force employees who have offers from Facebook to leave immediately?
Does the Java language have delegate features, similar to how C# has support for
Does C# have built-in support for parsing strings of page numbers? By page numbers,
I have a nightly database backup which I would like to scp to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.