Tag Info

New answers tagged

0

You need to setup the SFTP service (it's part of SSH but often times is disabled). Take a look at my answer to this U&L Q&A titled: How can I create an SFTP user in CentOS?. The key bits are making the following changes to your SSHD setup. Make these changes to your /etc/ssh/sshd_config file. Subsystem sftp internal-sftp ## You ...


1

The syntax you use in echo **/*(AIE) it for zsh; It does not work for bash, for example. The characters in the () are glob qualifiers; Multiple qualifiers are combined by logical AND - that is, they all ned to apply. So the command above shows filenames that are readable, writable and executable for the group. They have the permissions that are set by ...


1

You may try to use the following command-line method to find out your Apache group names: WWW_GROUP=`ps axo user,group,comm | egrep '(apache|httpd)' | grep -v ^root | uniq | cut -d\ -f 2` echo Apache group is: $WWW_GROUP To get the user, check: How to determine Apache user from the command-line?


0

Disable login: Prompts on Serial Ports Configuration Level Level-I Hardware Platform All OS Default No Zone Support Global zone only Reboot Required No Solaris Security Toolkit Use the disable-serial-login.fin Finish script. Scorable Item Yes Description: The pmadm command provides service administration for the lower level of the Service Access Facility ...


3

If you want to restrict a user to SFTP, you can do it easily in the SSH daemon configuration file /etc/ssh/sshd_config. Put a Match block at the end of the file: Match User bob ForceCommand internal-sftp ChrootDirectory /path/to/root AllowTCPForwarding no PermitTunnel no X11Forwarding no If the jail directory is the user's home directory as declared in ...


0

Like vinc17 said you only need read permission to compile you .c file. chmod 0444 <filename> Check the others permissions on: https://en.wikipedia.org/wiki/File_system_permissions#Symbolic_notation If you want to execute the .o file you should need execute permissions chmod 0111 <filename> EDIT: My bad about 777.


0

The user running GCC just needs to be able to read the file, e.g. -rw------- is OK if the user is the owner, otherwise 3 r may be needed (to do it simply). And if the user needs to store the compiled program in the same directory (most common case), he also needs write permission in this directory.


1

Assuming the partition mounted at /home/user/files is a Unix/Linux filesystem, such as ext4 or xfs, then simply: sudo chown user. /home/user/files chmod ug+rw /home/user/files


1

have you tried a chown, once the partition is mounted ? chown user /home/user/files/


2

Two options (both carried out as root): First If you're happy to have me be a member of the www-data group: Add the user me to the www-data group: # usermod -a -G www-data me Set the SetGID flag on the invoices directory: # chmod g+s /<path>/<to>/invoices Now, any files created in the invoices directory will have their group set to ...


1

Run chmod 755 /home and this should be fixed. Gilles answer here is worth looking at for a full explanation of this.


0

UNIX knows effective users/group with uid/gui not name. So check id and gid of your home directory. stat --printf=%u /home/heather #####print uid of your home dir stat --printf=%g /home/heather #####print gid of your home dir Then check with /etc/passwd and /etc/group : egrep heather /etc/passwd egrep heather /etc/groups


0

I use something like the following in my /etc/ssh/sshd_config file: Match User tom ChrootDirectory /var/www/html/my_project/ AllowTcpForwarding no X11Forwarding no ForceCommand internal-sftp Then, make sure tom has permission to access that directory. This can be tricky as tom would need at least 'x' (execute) permissions for all directories above the ...


0

You can maybe chroot the user tom in the /var/www/html/my_project/ by correctely configure your SFTP server. The access from apache will be allowed, and tom can't go up its chroot dir. To help you more, you need to say what SFTP server you are using.


2

Restoring permissions is a feature of unzip (from the man page, version 6.00): Dates, times and permissions of stored directories are not restored except under Unix. (On Windows NT and successors, timestamps are now restored.) and there is no option to switch if off. It might be that an older version of unzip did not support restoring permission, ...


0

As Patrick said in the comments I just needed to adjust the $PATH variable of the new user. What I did was logging in as root, copied the result from echo $PATH. Then I logged in as the new user and did: PATH=$PATH:[copy paste the $PATH result of root) All programs now work. Problem solved. /edit, problem not solved since it was not a permanent change. ...


0

Everything looks as expected. Since /data is rwx--x--x, only the owner, u1, can list it. Others can access files and subdirectories in it, subject to permissions on those files and subdirectories. In addition, userid 0 on NFS clients is mapped to userid 65534 (on some systems, -2) on servers unless you have no_root_squash in the export line (or, if running ...


2

Instead of chmod 777 /path/to/kppp you could do, setfacl -R -m user:username:rx /path/to/kppp Instead if you need to provide access to a particular group, you could do, setfacl -m g:somegroup:rwx /path/to/kppp


2

I found that the problem is sshfs trying to prevent other users (even root) from accessing my remote filesystem. Furthemore, accessing character devices (such as /dev/null) is problematic, and probably not what you want, because I guess that for example piping to /dev/null would effectively send bytes over the network. This is what I use now: mkdir ...


3

Since the release of 0.9 Docker has dropped LXC and uses its own execution environment, libcontainer. Your question's a bit old but I guess my answer still applies the version you are using. Quick Answer: To understand the permissions of volumes, you can take the analogy of mount --bind Host-Dir Container-Dir. So to fulfill your requirement you can use any ...


2

Only the “admin” user and members of the “shared_disk” group can access the /media/gal_db directory.  So, if you take “postgres” out of the “shared_disk” group, it can’t even get to the database directory.


0

with proper key settongs, assuming you can set thoses keys in myserver's app home dir. scp file.txt app@myserver:/etc/app/config/file.txt Step 1) in local host, check in $HOME/.ssh for any file name id_rsa.pub, if found goto step 3. Step 2) If not found, in local host (starting host) cd $HOME mkdir .ssh chmod go-rwx .ssh cd .ssh ssh-keygen accept ...


1

Try to add this to [Media] section: public = no hide unreadable = yes printable = no force create mode = 0664 force group = xbmc write list = xbmc directory mask = 0775 Do you authenticate to samba share as user xbmc under MacOS?


1

I don't see any usage except d-w--w--w- looks nicer than d---------, you can use it if you want to protect a directory from modifications. (just joking here)


2

You can do all the users' r and x permissions use a+rx and then you'll just need to add u+w for the owner's permissions to grant write access. $ chmod a+rx,u+w ... This will grant r and x to every one, and just u+w to the owner.


1

I usually think of the difference being that setting the permissions to 0777 explicitly sets them to 0777. As mentioned earlier, the leading 0 will be inferred if you just type 777. Whereas a+rwx adds read/ write/ execute leaving the setuid/ sticky bit untouched. Suppose you just want to be sure that a file is executeable, you might use a+x so that you can ...


20

[I edit to add best practice, following Dotancohen suggestion in his answer. I hope it doesn't make it less clear, and that the good habit is taken] Important additional information: They are not equivalent. chmod a+rwx : set the last 3 octals to 777, so it ensure that Owner, Group and Users have the "rwx" set. If there was aditionnal bits in the first ...


0

I would say that giving the numerical values is far more common in "simple peoples guides" such as those produced for users of budget web hosting. However, take care to specify them as octal, not decimal, values: $ chmod 0777 some_dir Note the leading 0 in 0777. This means octal. Note to downvoters: As clarified in the comments, the chmod command does in ...


16

Google gives: 1,030,000 results for 'chmod 777' 371,000 results for 'chmod a+rwx' chmod 777 is about 3 times more popular. That said, I prefer using long options in documentation and scripts, because they are self-documenting. If you are following up your instructions with "Run ls -l | grep file.txt and verify permissions", you may want to use chmod ...


0

Permission denied may refer to your .git directory. Try to do a sudo chown developer .git -R


0

You could add the dyndns name to /etc/hosts when you're at home so that it resolves to your local IP, and use some scripts easily add/remove it. Or install a DNS server on your local network that would resolve the dyndns name to your local IP.


1

i am using this single line version, easy to copy paste on top of scripts [ `whoami` = root ] || { sudo "$0" "$@"; exit $?; }


3

I'm not sure what best practice dictates as far as setting the "group" and "others" file permissions. A normal approach would be 755, so group and other have read-execute permission. Pretty much everything in (e.g.) /usr/bin is set that way. If I share my_file.sh and someone downloads it to their system, does the UID get changed to match their own? ...


1

Use normal Linux/Unix permissions on your dude/photos to make sure that popolo can't access them. Assuming that popolo isn't the owner of those files and directories and isn't in the group, then a simple chmod -R o-rwx dude/photos should make sure that popolo can't access those files. Or: An alternative way would be to give popolo and empty chroot home ...


1

First, when you add yourself to a group, the change is not applied immediately. The easiest thing is to logout and log back in. Then there are write permissions of data files (as mentioned already in some of the comments). However, the solutions are not good for security. Add a group for the game. Do not add any user to this group. Make the game ...


1

I am having the same issue. However by adding osec flag seems to be working for me. I cannot create any new file/folder, but can write to the existing files. //{ip_address}/{sharename} /mnt/server1 cifs (rw,nodev,uid=0,gid=0,credentials=/home/{user}/.smbcredentials,iocharset=utf8,file_mode=777‌​,dir_mode=777,osec=ntlmv2) 0 0 I have this on the ...


1

effective permissions are formed by ANDing the actual (real?) permissions with the mask.  Since the mask of your file is rw-, all the effective permissions have the x bit turned off.


0

As far as I understand there are no special operations like append and rename that you can configure. An append effectively is opening a file and then writing it with a different content (even if you only add to the file). You will need to have write privileges on that file. A rename effectively is moving a file from an old location to another new ...


1

Permission to remove and rename a directory is determined by its parent's permissions, not its own (just like other files). Just set the permissions on the directory to what you need and make its parent -w. Depending on your use case you may want to make the directory sticky +t as well - then users can't move around others' files, only their own.


0

1) In general, files in /var/www should be owned by root:www-data and chmod 644, while /var/www itself and all subdirectories should be chmod 755. They should not be writable by the www-data user unless absolutely necessary (and that goes triple for executable files) because files which are writable by www-data can be modified by an attacker who manages to ...


0

(1) chmod and chown are different commands. The first sets permissions and the second ownership. You may wish to also run `find /var/www/html -exec chown www-data:www-data {} +` in addition to the commands you are already running, but that is a choice for you to make. (2) You can edit /etc/cron.allow and add www-data to allow the www-data user to run ...


8

If you don't want to be challenged every time for your password then I'd recommend setting it to NOPASSWD in your /etc/sudoers file rather than hardcode your password in your logins. At least this way your primary login's password will remain intact and not be completely exposed in your .bashrc. To make this change run the command sudo visudo, and change ...


0

Most filesystems designed for Unix/Linux can be mounted with a nosuid attribute, which will prevent setuid or setgid binaries located on those filesystems from altering the effective uid or gid of a process. It's often used when mounting "untrusted" filesystems, those that are under the control of a non-administrator. In your case, the filesystem you're ...


1

If you fiddled with your home directory, you needed root to get at the /home directory that contains it. Possibly your home now contains some stuff owned by something other than you, that the sudo obviates. An aggressive approach might be "sudo chown -R myname:users ~myname" A more cautious person might do "find ~myname ! -user myname" to look for such ...


2

SetUID bit on executable allows to run executable at file owner (not superuser). To be able to run executable as root, execute: sudo chown 0:0 ./setuid-test


1

When a program wants to read or write to a file, it needs to call the system call open() for the file first. One of the arguments to the call specifies which operations the program wants to be able to do. It the program indicates it wants to read or write the file, and the process does not have the perspective for the operations, the open() call ends up in ...


3

When user tries to access a file or directory, the kernel allows to opens the file or directory with the mode parameter set to what permissions is assigned for that particular user. So if the user has only read permission the file opened by an application will be given only to read the contents of the file by the kernel.



Top 50 recent answers are included