Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have to create a shared folder under a directory, after that I have to create 2 users with their equally named home directories. It is required that the user can use the sudo command and both users should be able to edit each other's documents in the shared folder.
Can someone help me out with this? or give me the code, I tried adding users to the directory and stuff but I am stuck and also don't really understand the full exercise.
thank you
Creating the shared directory and common group
$ sudo mkdir -p /var/test
$ sudo groupadd test
Add the two user to the group
$ sudo usermod -a -G test user1
$ sudo usermod -a -G test user2
Set the permission to directory
$ sudo chgrp -R project /var/test/
$ sudo chmod -R 2775 /var/test/
Related
Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 months ago.
Improve this question
someone ask me but don't know The script install.sh requires elevated permissions to execute. Which command should be used to set execution permission?
chmod -r install.sh
chmod +x install.sh
chmod 400 install.sh
chmod -R 400 install.sh
chown install.sh
Firstly, the file should be owned by the correct user. If yes, then executing chmod +x install.sh or chmod 755 install.sh should give execute permission to that file
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 12 months ago.
Improve this question
I have this rule in my sudoers file
user ALL = (root) NOPASSWD:/usr/bin/supervisorctl
Now I can run the command without root password.
For example :
sudo supervisorctl restart all
My question is How can I run the command without sudo command ?
For example :
supervisorctl restart all
You should be able to make that work by setting the sticky flag:
sudo chmod +s /usr/bin/supervisorctl
You can try this out using whoami:
cp /usr/bin/whoami /tmp/whoami2
sudo chown root:root /tmp/whoami2
sudo chmod +s /tmp/whoami2
If you then run ./tmp/whoami2 as any user, you'll get root, i.e., the executable executes as the user with owner, given the sticky flag.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have permissions issue with www-data (apache) and just a linux user.
In my www folder is wp/
If I set:
sudo chown -R user.www-data wp/
My wordpress shows info it can write to a file, but if I set sudo chown -R www-data.user wp/ then WP works fine, but I can't create/delete folders/files in that directory in a file manager.
I've also added user to www-data group and www-data to user group, but it doesn't help. Still the same problem. What I'm doing wrong and how to solve this?
Try looking into chmod instead of chown.
Also, when using either of those commands, the syntax is user:group.
One solution is to chown -R user:www-data wp/
And then chmod -R 775 wp/
That will give both the user and the group www-data full access to the folder.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am trying to change access rights on tomcat-users.xml file under Linux Mint by:
chmod ugo+rwx tomcat-users.xml
But I'm receiving this error message:
Operation not permitted
tomcat-users.xml has the following permissions and attributes:
$ ls -la tomcat-users.xml
-rw-r-r-- 1 root root tomcat-users.xml
$ lsattr tomcat-users.xml
---------------e--- tomcat-users.xml
What am I doing wrong?
This command is correct is all ways but if there is an issue the, probably you would have been changing permissions of a file from a user(except root) who is not owner of the file.
Or if the owner is root then switch to it.
Or run the command from root.
And still does not work then go for
chmod u=rwx,g=rwx,o=rwx tomcat-users.xml
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
Newest Update
The flag is -p portnumber
but I can't get into root, got (publickey, permission denied)
I sign up for a vps on digital ocean.
Currently going through this tutorial https://coderwall.com/p/yz8cha and this railscast http://railscasts.com/episodes/335-deploying-to-a-vps
I made a new user inside the vps but this user doesn't have sudo priveledge
when I do cap deploy:setup according to the guide I am getting this
judy is not in the sudoers file. This incident will be reported.
failed: "sh -c 'sudo -p '\\''sudo password: '\\'' ln -nfs /home/judy/apps/lintong/current/config/nginx.conf /etc/nginx/sites-enabled/lintong'" on 192.241.241.204
I changed the port to 888 according to the guide and now I can't ssh into the server
when I do ssh root#ipaddress or ssh judy#ipaddress
its trying to connect to port 22
1st question
how do I pass in a field to when I ssh into the vps with a port option of 888?
2nd question
How do I give judy sudo rights?
according to coderwall's tutorial I should do this
visudo
then
add username ALL=(ALL:ALL) ALL but I think I did it before and it didn't work?
For recent Ubuntu/Debian versions, don't modify /etc/sudoers,
but add the user to to the sudo group in /etc/group.
sudo usermod -a -G sudo judy
or
sudo vigr (and sudo vigr -s)
To use ssh with a specific port, use -p 888 : i.e., ssh -p 888 judy#ipaddress
(Note that if you ever need to set a port with scp, you use a capital -P instead.)
Answering just one question:
ssh -p 888 root#ipaddress
should allow you to log in when ssh is listening on port 888. Not sure what is wrong with the second part... can you show the judy entry from /etc/sudoers?
For ssh to a different port:
ssh -p 888 root#ipaddress
To get judy sudo permission somewhat depends on the OS for proper practice. In Ubuntu you can simply add judy to the admin group.
useradd -G admin judy
This is because there's already an entry that maps that group in the sudoers file for Ubuntu servers.