SnapOverflow

SnapOverflow Logo SnapOverflow Logo

SnapOverflow Navigation

  • Home
  • Server
  • Ubuntu

Mobile menu

Close
  • Home
  • System Administrators
    • Hot Questions
    • New Questions
    • Tags
  • Ubuntu
    • Hot Questions
    • New Questions
    • Tags
  • Help
Home / server / Questions

Questions[file-permissions](server)

Martin Hope
Nick Weavers
Asked: 2020-01-24 15:53:46 +0800 CST

Why can I update a file owned by root using sudo vi, but not append a line to it with sudo echo "Thing" >> file?

  • 40

I would like to have script that is doing automated migrations of websites from another be able to append Includes to the /etc/httpd/conf.d/vhosts.conf file.

However, when I try to use echo to put append a string to the end of the file I get this:

$ sudo echo "Include thing" >> /etc/httpd/conf.d/vhosts.conf
-bash: /etc/httpd/conf.d/vhosts.conf: Permission denied

and yet I can vi /etc/httpd/conf.d/vhosts.conf, add the line and :wq the file to save and close it.

What am I missing?

sudo file-permissions redirection
  • 1 Answers
  • 3653 Views
Martin Hope
Robert
Asked: 2011-03-30 10:15:48 +0800 CST

ssh returns "Bad owner or permissions on ~/.ssh/config"

  • 556

When I try to ssh to another box, I get this strange error

$ ssh hostname
Bad owner or permissions on ~/.ssh/config

But I made sure that I own and have rw permissions on the file:

ls -la ~/.ssh/
total 40K
drwx------ 2 robert robert 4.0K Mar 29 11:04 ./
drwx------ 7 robert robert 4.0K Mar 29 11:04 ../
-rw-r--r-- 1 robert robert 2.0K Mar 17 20:47 authorized_keys
-rw-rw-r-- 1 robert robert   31 Mar 29 11:04 config
-rw------- 1 robert robert 1.7K Aug  4  2010 id_rsa
-rw-r--r-- 1 robert robert  406 Aug  4  2010 id_rsa.pub
-rw-r--r-- 1 robert robert 6.1K Mar 29 11:03 known_hosts
ssh file-permissions
  • 6 Answers
  • 479160 Views
Martin Hope
bmargulies
Asked: 2011-01-28 14:44:55 +0800 CST

What does a + mean at the end of the permissions from ls -l?

  • 188

What is the plus sign at the end of the permissions telling me?

ls -l
total 4
drwxrwxrwx+ 2 benson avahi-autoipd 4096 Jan 27 17:37 docs

Here's the context:

cat /etc/issue
\CentOS release 5.3 (Final)
Kernel \r on an \m
linux file-permissions
  • 2 Answers
  • 174301 Views
Martin Hope
JP19
Asked: 2010-12-28 09:53:48 +0800 CST

What Should be the Permissions of Apache SSL Directory, Certificate, and Key?

  • 60

I have my cert.pem and cert.key files in /etc/apache2/ssl folders.

What would be the most secure permissions and ownership of:

  1. /etc/apache2/ssl directory

  2. /etc/apache2/ssl/cert.pem file

  3. /etc/apache2/ssl/cert.key file

(Ensuring https:// access works of course :).

Thanks,

JP

apache-2.2 security permissions ssl file-permissions
  • 2 Answers
  • 88335 Views
Martin Hope
Gareth
Asked: 2009-05-11 21:13:03 +0800 CST

What's the best way of handling permissions for Apache 2's user www-data in /var/www?

  • 230

Has anyone got a nice solution for handling files in /var/www? We're running Name Based Virtual Hosts and the Apache 2 user is www-data.

We've got two regular users & root. So when messing with files in /var/www, rather than having to...

chown -R www-data:www-data

...all the time, what's a good way of handling this?

Supplementary question: How hardcore do you then go on permissions?

This one has always been a problem in collaborative development environments.

linux debian apache-2.2 file-permissions www-data
  • 4 Answers
  • 179227 Views

Sidebar

Stats

  • Questions 681965
  • Answers 980273
  • Best Answers 280204
  • Users 287326
  • Popular
  • Answers
  • Marko Smith

    Can you pass user/pass for HTTP Basic Authentication in URL parameters?

    • 5 Answers
  • Marko Smith

    Ping a Specific Port

    • 18 Answers
  • Marko Smith

    Check if port is open or closed on a Linux server?

    • 7 Answers
  • Marko Smith

    How to automate SSH login with password?

    • 10 Answers
  • Marko Smith

    How do I tell Git for Windows where to find my private RSA key?

    • 30 Answers
  • Marko Smith

    What's the default superuser username/password for postgres after a new install?

    • 5 Answers
  • Marko Smith

    What port does SFTP use?

    • 6 Answers
  • Marko Smith

    Command line to list users in a Windows Active Directory group?

    • 9 Answers
  • Marko Smith

    What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats?

    • 3 Answers
  • Marko Smith

    How to determine if a bash variable is empty?

    • 15 Answers
  • Martin Hope
    Davie Ping a Specific Port 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    Smudge Our security auditor is an idiot. How do I give him the information he wants? 2011-07-23 14:44:34 +0800 CST
  • Martin Hope
    kernel Can scp copy directories recursively? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh returns "Bad owner or permissions on ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil How to automate SSH login with password? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin How do I deal with a compromised server? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner How can I sort du -h output by size 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent How to determine if a bash variable is empty? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus How do you find what process is holding a file open in Windows? 2009-05-01 16:47:16 +0800 CST

Related Questions

Trending Tags

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Home
  • Questions
    • Hot Questions
    • New Questions
  • Tags
  • Help

Footer

SnapOverflow

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Help

© 2022 SOF-TR. All Rights Reserve