Executing bash file with sudo for the second time, leads to permission denied, for commands
I have a script that checks if the script has been ran with sudo. If the script is not ran as sudo, the current script is being executed with exec sudo bash. You are asked for a password, you type in the password, success. Everything is perfect - the commands inside the script are ran as sudo. However, the second time you run the script, you are getting cat: /etc/sudoers: Permission denied
Hi All,
When I execute a command on Unix and it says 'Permission denied'. What could be the reason and how can it be resolved?
Many thanks,
David (2 Replies)
Hi All,
I have two servers, say server1 and server2.
I have put the entries of both servers in /.rhosts file of both servers.
So, when I tried to run following from server1-
rsh server2 "ls"
Permission denied was printed on console.
Can anyone help me out?
Regards,
akash mahakode (4 Replies)
Hi Gurus,
I am new to scripting and needs your help in expect script used for telnet. I wrote a simple script as
#!/usr/bin/expect-5.43 -f
spawn telnet localhost 2233
expect "password:"
send "secret\r"
send "i data.cnbc.com\r"
send "exit\r"
expect eof
When I am trying to execute... (2 Replies)
HI All,
I am using solaris
i created a user adam and updated his permissions
in vi sudoers file as follows
adam ALL=(ALL) NOPASSWORD: ALL
...........
when i create user by logging as sudo user .
$ sudo useradd -d /home/kalyan -m -s /bin/sh kalyan
sudo: not found
... (6 Replies)
Hello,
I have a problem creating files in a certain folder. I installed apache and mysql today, using this guide:
http://computerfaq.be/ubuntu-apache-mysql-php-server-installeren/
(can't post links yet :( )
Instead of /home/www/html I used /home/www/ for the document root.
Now I... (12 Replies)
I'm sure this question comes up a lot, but I'm particularly confused in this situation.
I can run my program once, just fine. However, if I try to run it again without recompiling, bash refuses to give me permission. I have a small idea why, but I don't think think I'm right.
Here's what I'm... (1 Reply)
I have a script that writes another script with
cat >/usr/local/bin/myscript.sh <<EOF
#!/bin/sh
VAR=`run a command here`
EOF
Problem is, after this is run, I get:
$ cat /usr/local/bin/myscript.sh
#!/bin/sh
VAR=result of command
How do I stop that from happening with Macs... (2 Replies)
my file permissions are -rwxrwxrwx for runInstall file
and while giving " sudo bash runInstall.sh " then i am getting error " permission denied"
now i don't see any reasonable answer for that please suggest what should i do?
:eek:
got to start DBConnection practice with oracle database and... (4 Replies)
Hi
Am having file.ksh as below
wc -l file1.txt
wc -l file2.txt
wc -l file3.txt
wc -l file4.txt
i want all the commands in this file to execute in same time
please help
Thanks in advance (1 Reply)
Hi All,
i have two accounts with acl permissions. I need to provide read access to both users. for one user s109552
"cd" is not working.
drwxrws---+ 8 cvsadmin reto 1024 Aug 23 2011 reto
su5sr117# su - s109553
$ bash
bash-3.2$ cd /rep/reto
bash-3.2$ pwd <-------- it... (2 Replies)