1
vote
0answers
44 views

Disable commands for users [duplicate]

I have users that login automatically via ssh to a script I defined instead of a shell. The script basically launches a program which has a shell-escape in it which would allow the user to execute ...
3
votes
3answers
199 views

Convert the permissions in `ls -l` output to octal [duplicate]

I want to convert the output of ls to octal permission bits. I think of the shortest and clearest way to implement that excerise: Let's say that we have as input: total 1 drwxr----x 1 user2 workers ...
1
vote
2answers
136 views

Running a bash script as root prevents asynchronous execution?

The script below get's executed differently if run as a root user. #!/bin/sh gnome-terminal -x sleep 10 echo 'Why must I wait for sleep to finish?' If its run as a regular user, message is ...
2
votes
2answers
386 views

Allow NonRoot User to Mount a Particular NTFS External Hard Drive

I have a 4TB external hard drive connected to an Linux server. The fstab permissions on this drive are set so that only one particular non-root user has access to it: ...
0
votes
1answer
2k views

How do I set permissions recursively on a dir (with ACL enabled)?

For example, I want to give my colleagues write access to certain directory. Let's assume that subdirectories in it had access rights 775, files 664, and also there were some executable files in the ...
4
votes
3answers
384 views

How to inspect group permissions of a file

I would like to inspect group permissions of a file from a bash script. Specifically, I need to check whether a file has the group writeable bit on. That's it. Simple as that. However: I also need ...
5
votes
3answers
471 views

Maintain (or restore) file permissions when replacing file

I have a command that accepts a file as an argument, modifies the file, then writes it to the file name specified in the second argument. I'll call that program modifyfile. I wanted it to work "in ...
0
votes
3answers
371 views

Create a file as a different user and group

I have a bash script with downloads some files, and then needs to set the owner to apache, and the group to a particular user group (that apache is not a member of). Is there a way to create those ...
0
votes
1answer
80 views

File permissions when mixing command line and server

I have a PHP server which creates folders and files for certain things. I also run supporting code from the command line operating on the same folders and files. The problem is that when running from ...
3
votes
2answers
130 views

Log in as one user but authenticate as another

This might be a weird question but I wonder if there are possibilities to this. When I'm configuring a system I prefer to be root so that I don't have to sudo everything. However, the root account is ...
1
vote
3answers
600 views

Setting file permissions in bash script

This script is not working the way I thought it would .I though it would find all the scripts that have every one rwx permissions changed to the permissions of xx5 #!/bin/bash # the / makes find ...
1
vote
3answers
291 views

Finding lists of files with specific permissions

I looked into the find command and came up with find . -maxdepth 1 -perm 521 > test.txt to output the permissions to a text file, but is it possible to do it just using, for example, simple ...
3
votes
2answers
297 views

Why do I have to use sh to execute scripts from CD/DVD media?

I hit again on this strange behaviour of the system. I'm running Debian 6.0.6 and had quite some troubles executing a script directly from CD/DVD. Finally I had to use: sh /media/cdrom/command to ...
22
votes
1answer
2k views

Why can't root execute when executable bits are not set?

root user can write to a file even if its write permissions are not set. root user can read a file even if its read permissions are not set. root user can cd into a directory even if its execute ...
5
votes
3answers
4k views

bash: /dev/stderr: Permission denied

After upgrading to a new release version, my bash scripts start spitting errors: bash: /dev/stderr: Permission denied in previous versions Bash would internally recognize those file names (which is ...
5
votes
5answers
221 views

Is there a way to see the permissions of all the intermediate directories of a path..?

I have a file path.. Is there any single command to see the file/directory permissions of all the intermediate directories in the path..?
3
votes
1answer
829 views

“Permission denied” when starting binary despite “rwx” priviledge

I am trying to run the statistics software Stata 11 on Ubuntu 11.10. as a regular user and I get the following error message: bash: xstata: Permission denied The user priviledges seem ok to me as a ...
3
votes
2answers
101 views

Can I run a command with specific privileges on certain directories?

I would like to be able to run a command, passing in parameters to bash or similar, such that this command is not allowed to write to a particular path, overriding the user's other privs. Eg: ...
2
votes
2answers
456 views

I can create a file but I can't read from it

I've been using linux for a while, but I always had root access, so permission problems were no big deal. But now I don't have root access and it's driving me mad. I have a ssh access to a web ...
4
votes
2answers
393 views

Directory special permission problem

When I write: chmod g=rws,u=rwx,o=rx folder_name I get: drwxrwSr-x But S is not the same as s, right?
8
votes
5answers
2k views

How to run part of a script with reduced privileges?

I have the following problem: On every machine running Postgresql there is a special user postgres. This user has administrative access to the database server. Now I want to write a Bash script that ...
4
votes
2answers
5k views

How to get a program running with root privileges without using su or sudo

I have a bash script that needs to run with root privileges, but must be invoked by the normal user. Difficult part is that the script should not ask for a password, and I don't want to use the ...
2
votes
3answers
1k views

How do I force the user to become root

I have written a bash script for use on my ubuntu box. Now I would like to prevent running this script under my own user and only able to run it as root (sudo). Is there a possibility to force this. ...