Shell Script to validate the access for Servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Script to validate the access for Servers
# 1  
Old 02-16-2018
Shell Script to validate the access for Servers

Hi Experts,

Please advise to Write a Shell script,
  1. To check , whether the user has access to UNIX PRODUCTION server or not?
  2. If no, then need to provide the access to UNIX PRODUCTION server and then need to provide access to print only few FILES.
  3. After connecting to ther server, again need to check wheter the user is having access to Oracle PRODUCTION Database or not?
  4. If no then need to provide the access/grants to Oracle PRODUCTION Database and provide the grants to SQL Loader and specific PROCEDURES/FUNCTIONS.
  5. Need to create a LOG for this entire process
    Eg:
    1. Whom we are giving access
    2. Database Name :
    3. Unix Server Name :
    4. Date :
    5. User Login Time :
    6. User Logoff time :
      etc ::



Thanks,
Vasu

Last edited by rbatte1; 02-16-2018 at 10:20 AM.. Reason: Formatted nested numbered lists
# 2  
Old 02-16-2018
Hello vasuvv,

I have a few to questions pose in response first:-
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.


Kind regards,
Robin
# 3  
Old 02-19-2018
Robin,

After reviewing many threads Here I have written the script to connect to database. With this I can see am able to connect to Datase by giving my credentilas.

Code:
#!/bin/ksh
sqlplus -s userID/password@DB_INSTANCE @Test.sql & 
sqlplus -s  userID/password@DB_INSTANCE << EOF
exit
EOF

But not sure whether that specific user has access for the expected servers. So suggestions from you..


Moderator's Comments:
Mod Comment Please use CODE (not ICODE) tags as required by forum rules!

Last edited by RudiC; 02-19-2018 at 08:04 AM.. Reason: Changed ICODE to CODE tags.
# 4  
Old 02-21-2018
Experts,

It would be great if someone can advise..

Thanks,
Vas
# 5  
Old 02-21-2018
Quote:
Originally Posted by vasuvv
Experts,

It would be great if someone can advise..

Thanks,
Vas
If you are unable to answer the questions that Robin asked in post #2 in this thread, there is little chance that you will get much help. We depend on the information you provide to get the information we need to be able to help you.
# 6  
Old 03-02-2018
Don,

Please find below for Robin's queries

What have you tried so far?
--Have posted the code which will to connect to Database or not.
What output/errors do you get?
-- Was not able to write any other scripts apart from the posted one.

What OS and version are you using?

--Am using UNIX OS

What are your preferred tools? (C, shell, perl, awk, etc.)

-- SHELL

Thanks
Vasu
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script to delete files from 5 different servers

Hello, I'm new to shell scripting and need a quick note on how to write a shell script to perform deletion of files from 5 different hostnames in various locations. Found out to delete files from one path by using below command and made it to work on cron job but need to do it in a shell... (2 Replies)
Discussion started by: Teja G
2 Replies

2. Shell Programming and Scripting

Shell script for remote servers

Hi , I have written a small script : set -x #!/bin/ksh for i in `cat /tmp/list` ( list contains remove servers ) do ssh -t $i << EOF uname -a cd ~user echo "Enter the dir >" read dir path=`ll -ld /home/user/"$dir"` if ; then echo "Dir exists " read rm $path else echo "no such... (9 Replies)
Discussion started by: kpatel786
9 Replies

3. Shell Programming and Scripting

Writing a script to access many servers

Hi there, I'm writing a simple script (in a batch file) to access a number of servers with a number of different credentials (users/passwords/root passwords etc). What I need is a way to execute commands as root. I'm currently using the batch file to read the server information out of a text... (2 Replies)
Discussion started by: jlpicard
2 Replies

4. Shell Programming and Scripting

Need a ready Shell script to validate a high volume data file

Hi, I am looking for a ready shell script that can help in loading and validating a high volume (around 4 GB) .Dat file . The data in the file has to be validated at each of its column, like the data constraint on each of the data type on each of its 60 columns and also a few other constraints... (2 Replies)
Discussion started by: Guruprasad
2 Replies

5. Shell Programming and Scripting

Validate file count in korn shell script

Hi, I have files in the directory like below which I need to validate if all the required files are present. A_B_001 of 002_time1.txt A_B_002 of 002_time1.txt A_B_001 of 001_time2.txt Scenarios- a)If file with 001 of 002_time1 or 002 of 002_time1 is missing in the folder,script should... (6 Replies)
Discussion started by: aneeta13
6 Replies

6. Shell Programming and Scripting

Shell script to search a keyword in six different servers

Hello, I need a shell script which takes search keyword as input and then searches logs in six different servers and provide me the logs where in it found the keyword. Can anyone help???? (1 Reply)
Discussion started by: tomlui2010
1 Replies

7. Shell Programming and Scripting

connecting servers using shell script

Hi , I have three linux servers. I want to login from one server and check some status in the other server. How to connect other server from one server using shell script. Can anyone advice on this? Thanks, Chelladurai. (4 Replies)
Discussion started by: ckchelladurai
4 Replies

8. Shell Programming and Scripting

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each certificate and send the mail to the user. The user takes action to add the new certificate to the storage file and user owns the responsibility to update the input text file with the new certificate... (5 Replies)
Discussion started by: casmo
5 Replies

9. UNIX for Advanced & Expert Users

Script to access multiple linux servers to get system details such as CPU usage

Hi Is there any shell script that accesses multiple linux servers to get details such as CPU usage, RAM used etc. The access of the servers must be parallel not serial in the sense it must ping all the servers at a time to get information.The script has to be triggered from a host system and get... (7 Replies)
Discussion started by: mssrivatsa
7 Replies

10. Shell Programming and Scripting

Connect two servers in shell script

Hello all, I know that is a question which has made too many times, and I have been looking into the threads but all posted was not sucessfully for me so... I need a shell script which connect two unix servers, but NOT using ssh... Is there another way to do it? I've tried ssh but it didn't... (1 Reply)
Discussion started by: Geller
1 Replies
Login or Register to Ask a Question