Help with scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with scripts
# 8  
Old 03-06-2019
Quote:
Originally Posted by rbatte1
share the screen output (pasted in CODE tags) from the following:-
Code:
uname -a
getent group your_group_name
getent user permitted username
ls -l /path/to/folder
ls -dl /path/to/folder

In addition: please post the filesystem type the FS in question is using. You get this by looking at the output of df /path/to/folder and then, using what shows up in the last column, doing a mount | grep <last-value>. i.e.:

Code:
# df /path/to/look/at
Filesystem             1K-blocks   Used Available Use% Mounted on
/dev/mapper/mylv         5029504 798444   3952532  17% /path

# mount | grep path
/dev/mapper/mylv on /path type ext4 (rw,relatime,data=ordered)

The background of this question is that some sorts of filesystems have different properties and migh make adjustments to the suggested procedure necessary.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
# 9  
Old 03-07-2019
Hi,

I tried giving permission to the user a by using the below command.
Code:
sudo chown -R  o:ec2-user /*

After that i lost my root user access.I dont know the password of root and i have logged in the ec2-user user by using pem key without password.Now i am not able to login ec2-user it is asking password.I have all installed under ec2-user only.
I can able to login only o user with the password.If I do ls nothing is there under "o".
Code:
o@  ~cd /
o@  ~ cd ec2-user
-bash: cd: ec2-user/: Permission denied

Can anyone help me to get root access as well as ec2-user access?

Regards,
Iswarya.M




Moderator's Comments:
Mod Comment Seriously: Please use CODE tags as required by forum rules!

Last edited by RudiC; 03-07-2019 at 07:07 AM.. Reason: Added CODE tags.
# 10  
Old 03-11-2019
Hi ,
can anyone help me in the above ?

Regards,
Iswarya.M
# 11  
Old 03-11-2019
Quote:
Originally Posted by iswarya123
can anyone help me in the above ?
First off: please do not bump up threads. If someone can answer you s/he will - and if not, then bumping up the thread won't help you either. Many people here do not visit unix.com regularly on weekends which is probably why your thread hasn't been answered up to now.

Second: yes, i can help you but are not going to like what i say.

The first thing is, you have generally no business tampering with the ownership of rights of files put there by the system. Actually you can do that in select few exceptional cases but if you do that you have to understand you are taking a very big risk and so you should know what you are doing and why pretty clearly beforehand. I like it better that way is NO such reason to do it.

The reason why sudo refuses to use /etc/sudoers now is because it needs to be readable/writable only for root for security reasons. It doesn't make sense to have rules about who is allowed to become root writable by anybody else but root.

Therefore, by changing the right of the file you have made sudo absolutely useless and effectively shut it off. You need a "conventional" way of becoming root therefore, but in many cases these are blocked intentionally for security considerations.

One way is to use su - root and switch to the root user. You need the root password for that and su may be forbidden to be executed.

Second way is to log on as root directly. You also need the root password and root may be forbidden to log on remotely or generally. If it is only forbidden to log on remotely you can log on locally - usually via the KVM, ILO or whatever the maintenance access to the server is called - via a local serial console.

Third, you can use a boot-CD and reboot the server from that, then mount the original root filesystem (/etc is probably located there) and change the rights back to what it was. Then reboot the server from its own filesystem and it should work again. You will need local access to the server for this and the procedure is going to be disruptive.

I hope this helps.

bakunin
These 2 Users Gave Thanks to bakunin For This Post:
# 12  
Old 03-13-2019
Hi,

sudo issue has been resolved.Thanks bakunin.can i create the more than 20 user under the group?I asked to share the few details ..please find the below

Code:
uname
linux
 getent group o
o:x:id:t
ls -l /path/to/folder
-rwxr-xr-x.
df /path/to/folder
Filesystem     1K-blocks      Used Available Use% Mounted on
/*                 838848492 611327160 227521332  73% /
getenforce
Disabled

Regards,
Iswarya.M
# 13  
Old 03-14-2019
Hello iswarya123 ,

Well, I did ask for the -a flag of uname so we got version information. That would be useful in all cases because things change. Just knowing "linux" is pretty useless..

Really, do you have a group called o? Why not something more meaningful? A few more characters would be so much easier for you to understand when you come to look at it later.

Are there no files in /path/to/folder? You don't sho us the long listing in any case (size, time/date etc. is missing)

Please do answer the questions posed in future to help us understand what we are working with. That way we are better placed to help, and that's why you are here in the first place, no? I joined to get help and I think almost everyone else did too. If you don't share what you are asked for (without compromising security or sensitive data, of course) then we are a little blind to the issue and what we can do to help. I don't want to moan, but ......... Smilie


I look forward to your next question, and I hope I can help, preferably before someone else beats me to it!


Kind regards,
Robin
This User Gave Thanks to rbatte1 For This Post:
# 14  
Old 03-21-2019
Hi ,
Please find the below:
Code:
getent group ec2-user
ec2-user:x:1000:iswarya

I have attached the permission ,size, time/date and uname -a in that attachement.

Please let me know if anyone needs few more information

Regards,
Iswarya.M
Help with scripts-llpng
Help with scripts-uname-png

Last edited by iswarya123; 03-21-2019 at 08:22 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies

2. Shell Programming and Scripting

Calling scripts from with scripts

Hi all, I'm wondering if you could give me some advice. I am new to scripting and am getting rather frustrated that i can get my script to call another script if certain criteria is met, via command line, but I cannot get the same script to work thru the cron jobs. My first script monitors... (8 Replies)
Discussion started by: echoes
8 Replies

3. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

4. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

5. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

6. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

7. UNIX for Dummies Questions & Answers

Profile scripts versus rc scripts....

what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies

8. Shell Programming and Scripting

Calling expect scripts from other expect scripts

Hi, First, let me explain the issue I am trying to solve. We have a lot of expect scripts with the duplicated send/expect commands. So, I'd like to be able to extract the duplicated code into the common scripts that can be used by other scripts. Below is my test where I am trying to call... (0 Replies)
Discussion started by: seva
0 Replies

9. UNIX for Dummies Questions & Answers

Help with scripts

script that ask for "enter a file name" and removes that file and asks for confirmation before deletion if executed the output might look as enter the filename you intent to deleted remover file? Y file deleterd I knwo the comand I would use find . -name *.* -ok rm {}\; I guess... can... (1 Reply)
Discussion started by: LiTo
1 Replies
Login or Register to Ask a Question