Tag Archives: SU

How to use SU inside script?

By rafae11

hi guys,

I new to unix im generating a script within c code.
I need to upgrade the software to a newer version and in need su privilege.
what is the correct syntax in running su within the script?

i would greatly appreciate your help
many thanks
rafael

Code:

/* Y o u r D e s c r i p t i o n */
/* AppBuilder Photon Code Lib */
/* Version 2.03 */

/* Standard headers */
#include
#include

#include
#include
#include
#include
#include

/* Local headers */
#include "ablibs.h"
#include "AppGlobal.h"
#include "abimport.h"
#include "proto.h"
#include "version.h"

#include
#include

struct stat sb;

using namespace std;

int
Yes( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )
{
// find where abc/123/version x is located
system("find /fs/*/abc/123/*/ > /root/find.txt");

// only read the first result
std::string line;
std::ifstream stream("/root/find.txt");
getline(stream,line);

// current version
int maj = VERSION_MAJOR;
int min = VERSION_MINOR;
int pat = VERSION_PATCH;

// comparing to
int maj_comp = 0;
int min_comp = 0;
int pat_comp = 0;

// check if it is a valid folder
if (stat(line.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode))
{
unsigned found = line.find_last_of("/");

stringstream line_to_int;
line_to_int << line[found-5];<br ...read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Japan says 2 Russian fighters briefly entered its airspace

Japan‘s Defense Ministry said two Russian fighter jets briefly intruded into Japanese airspace Thursday off the northwestern tip of the island of Hokkaido, prompting Tokyo to lodge a protest.

Japanese air force jets scrambled after the intrusion by the two SU-27 jets off the coast of Rishiri island, which lasted less than a minute, ministry official Yoshihide Yoshida said.

Yoshida said it was not immediately known whether the airspace violation was intentional or accidental, but that it was “extremely problematic.” The last intrusion by Russian jets in Japanese airspace was on Feb. 9, 2008, he said.

Japan‘s Foreign Ministry lodged a protest with the Russian Embassy in Tokyo.

Another ministry official who spoke on condition of anonymity said it was not immediately clear whether it was related to a government-sponsored rally held Thursday demanding that Moscow return a group of disputed islands off Hokkaido’s eastern coast.

Prime Minister Shinzo Abe told the rally that he will do his utmost to resolve the dispute with Russia, which has kept the two nations from signing a peace treaty officially ending their hostilities in World War II.

…read more
Source: FULL ARTICLE at Fox World News

Cannot su to a user in AIX

By Vijay Gurusamy

Hi All,

We are facing the below issue when we try to SU to a user in AIX

0:root@dehensv215:/var/adm # su – orac38
foreach: Words not ()’ed.
% pwd
/oracle/C38
% ls

We are able to login to other admin user in the same server only problem is with this user orac38.

Guess some problem with environmental variables,

We are not able to login to this user and we are facing problems because of this issue.

Please help and provide your suggestions in this regard.

Thanks,
Vijay

Source: FULL ARTICLE at The UNIX and Linux Forums

Trouble with Kerberos/LDAP and AIX 6.1

By jgeiger

The KRB5ALDAP compound load module is giving me fits. Everything looks like it should be working, but no.

Goal: Integrate AIX host with Active Directory using a KRB5ALDAP compound load module so that users can be created in AD and used in AIX, with unix attributes (registry values) being pulled from AD. Eliminate the need to manage user accounts on a per-server basis.

Issue: User attributes are visible with lsuser and returned with ldapsearch. Kerberos authentication shows successful at the domain controller, but a “permission denied” or “invalid login or password” message is displayed. Files can be chown-ed to the user accounts, but SU fails.

I attached a doc with the pertinent configs and troubleshooting steps. Since making that doc, I have also chased the enctype (switched to solely RC4) and the KVNO (tried 2, 3, 4). But no love.

Any help would be greatly appreciated.

Source: FULL ARTICLE at The UNIX and Linux Forums