.bashrc file not created in ldap client machine when using ldap authentication - openldap

My objective is to configure a machine as client to use ldap authentication from a ldap server. I added user in ldap server. Also registered ldap service to be used by client.
But the problem is when I am trying to login into the ldap client machine, I am not getting the "user#hostname" prompt, instead I am getting "-bash-4.1$".
I searched and find its something to do with ".bashrc" files such as ".bash_history", ".bash_profile", ".bash_logout".
I can manually create these files but I want them to be automatically generated, and executed while login.
If anyone knows the cause of the problem and the solution please share.
Thanks,
Yogesh

You should create a script in /etc/profile.d for this propose, like that:
cat /etc/profile.d/bash_create.sh
a='export PS1="\[$(tput bold)\]\[$(tput setaf 2)\][\u#\h \W]\\$ \[$(tput sgr0)\]"'
b='export other variable'
c='export other variable'
d='alias ...."
if [ ! -f BASHRC ]; then #if not exists
echo -e "$a\n$b\n$c\n$d" >> $BASHRC
source $BASHRC #execute bash script
fi

I had this problem too and I solved deleting the "/home/< ldapuser >" and then I login again and the home directory was created. Also you can check if /etc/pam.d/system-auth has properly pam_oddjob_mkhomedir.so
session optional pam_oddjob_mkhomedir.so umask=0077
To enable mkhomedir you can run
authconfig --enablemkhomedir --update

Related

Deploy on Meteor galaxy server with bitbucket and deployment token as variable

Hello I want to use the automatic deploymen on bitbucket to the galaxy server with a deployment token.
For this reason I am creating a deployment token that is comitted in the repository.
https://galaxy-guide.meteor.com/deploy-guide.html#deployment-token
To strenghten the security I would like to use Repository variables in bitbucket pipelines:
https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html
And to store the deployment token of meteor in the variables instead in file.
For the deployment we use in the command:
METEOR_SESSION_FILE=deployment_token.json
And my question is - Is there any way so that I use some variable(string) where the token is used like
METEOR_SESSION_DEPLOYMENT_TOKEN=$METEOR_TOKEN
instead to call it from a file?
Some research, after having the same problem, brought me to this article, which simply solves the problem that you can't feed meteor just the json in an env var in the following simple way:
By adding the json file content as an env var and then echoes it out into a file on deploy.
echo $METEOR_TOKEN_FILE > deploy_token.json
METEOR_SESSION_FILE=deploy_token.json
Thanks to this article I figured it out.
Save json settings as env variable and then in deployment procesS:
echo $DEPLOY_SESSION_FILE > deployment_token.json
METEOR_SESSION_FILE=deployment_token.json DEPLOY_HOSTNAME=galaxy.meteor.com meteor deploy --allow-superuser myApp-staging.meteorapp.com --settings config/staging/settings.json --owner username

Changing domain name from localhost to custom in meteor.js

I tried to change domain name of my project with the following command
$ set ROOT_URL=http://mixer.example.com:3000
$ meteor
And that seems to work according to output
=> Started your app.
=> App running at: http://mixer.example.com:3000
Type Control-C twice to stop.
But I can't open page at this address, it still opens only on localhost. What should I do to fix this?
If you are looking to run it with the domain locally...you need to change your hosts file (/etc/hosts) and add the domain and point it to localhost. In your case, it would look something like this:
127.0.0.1 mixer.example.com
This worked for me without doing anything else:
ROOT_URL=http://mydomainname.test:3000/ meteor --port 3000 --settings settings.local.json

Weblogic 12C sending logs to syslog

I want to send my weblogic log to syslog. here is what I have done so far.
1.Included following log4j.properties in managed server classpath -
log4j.rootLogger=DEBUG,syslog
log4j.appender.syslog=org.apache.log4j.net.SyslogAppender
log4j.appender.syslog.Threshold=DEBUG
log4j.appender.syslog.Facility=LOCAL7
log4j.appender.syslog.FacilityPrinting=false
log4j.appender.syslog.Header=true
log4j.appender.syslog.SyslogHost=localhost
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
log4j.appender.syslog.layout.ConversionPattern=[%p] %c:%L - %m%n
2. added following command to managed server arguments -
-Dlog4j.configuration=file :<path to log4j properties file> -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dweblogic.log.Log4jLoggingEnabled=true
3. Added wllog4j.jar and llog4j-1.2.14.jar into domain's lib folder.
4.Then, from Admin console changed logging information by doing the following. "my_domain_name"--->Configuration--->Logging--->(Advanced options)-->Logging implementation: Log4J
Restart managed server.
I used this as refernce. But didnt get anaything in syslog(/var/log/message). What am I doing wrong?
I would recommend a couple items to check:
Remove the space in DEBUG, syslog in the file
Your last two server arguments have a space between the - and the D so make sure that wasn't just a copy and paste error in this post.
Double check that the log files are in the actual classpath.
Double check from a ps command, that the -D options made it correctly into the start command that was executed.
Make sure that the managed server has a copy of the JARs correctly as they would get synchornized from admin during the restart.
Hopefully something in there will help or give an idea of what to look for.
--John
I figured out the problem. My appender was working fine, the problem was in rsyslog.conf. Just uncommented following properties
# Provides UDP syslog reception
#$ModLoad imudp
#$UDPServerRun 514
We were appending the messages, but the listner was abesnt, so it didnt knew what to do with it.
and from *.debug;mail.none;authpriv.none;cron.none /var/log/messages it figures out where to redirect any (debug in this case) information to messages file.

SBT not passing credentials when publishing to Artifactory

I am coding a Java project and I'm automating the build and the publishing to JFrog Artifactory using SBT.
Whenever it's time to publish to Artifactory I want to do it using the Ivy directory layout and obviously publish the Ivy XML file along with the jar. I managed to achieve this by using the following lines in the build.sbt file:
crossPaths := false
publishTo := Some("Artifactory Realm" at "http://<Artifactory IP>:<Artifactory Port>/artifactory/org.project.my")
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")
publishMavenStyle := false
However it only works when anonymous users are allowed to deploy into Artifactory. I realized that sbt is not really passing my credentials to Artifactory but, instead, logging in as anonymous.
My $HOME/.ivy2/.credentials file looks like this:
realm=Artifactory Realm
host=http://<Artifactory IP>:<Artifactory Port>/artifactory/org.project.my
user=<my user name>
password=<my user name>
However, if I change the Artifactory configuration in order to prevent anonymous users from deploying new Artifacts, when I run "sbt publish" I get the following output:
[error] Unable to find credentials for [Artifactory Realm # <Artifactory IP>].
java.io.IOException: Access to URL http://<Artifactory IP>:<Artifactory Port>/artifactory//org.project.my/org/project/my/project-my/1.0.0/project-my-1.0.0.jar was refused by the server: Unauthorized
The Artifactory request.log file then contains:
20160219011657|319|REQUEST|10.0.2.2|anonymous|PUT|/org.project.my/org/project/my/project-my/1.0.0/project-my-1.0.0.jar|HTTP/1.1|401|24978
I have also tried passing the credentials manually instead of using a file:
credentials += Credentials("Artifactory Realm", "localhost", "<USERNAME>", "<PASS>")
But I am getting the same result.
Any idea what I might be missing?
try:
host=<Artifactory IP>
old answer (doesn't work):
host=<Artifactory IP>:<Artifactory port>
I had a different problem: I had the wrong realm set on my .credentials file.
Looking at the error output from sbt, I was able to figure out that I should use:
realm=Artifactory Realm
Error shows the expected values for realm and host:
[error] Unable to find credentials for [Artifactory Realm # myhost].

System.UnauthorizedAccessException: Access to path is denied

Good afternoon,
I have recently purchased a server with Plesk 12 as the Control Panel.
I don't have much experience using Plesk.
For testing purposes, I created a simple ASP.NET project which tries to read/write from a txt, as shown below:
String logPath = #"C:\inetpub\vhosts\xxx.com\httpdocs\log_application_error.txt";
StreamWriter textWriter = new StreamWriter(logPath, true);
When the StreamWriter instance is created, I get the following error:
System.UnauthorizedAccessException: Access to the path 'C:\inetpub\vhosts\xxx.com\httpdocs\log_application_error.txt' is denied.
I tried granting read/write permissions to the txt file, and even granted Full Control to "Everyone", but the result was the same.
Plesk seems to hide everything so that it is handled through the Control Panel. I don't see any Applications Pools on the IIS so I am not even sure what is the identity it is running under.
Any help would be greatly appreciated.
Try to set "Additonal write/modify permissions" at "Hosting settings" of your domain:
Try to fix it with following commands:
cacls C:\Windows\assembly\GAC_MSIL /E /R psacln /T /C
cacls C:\Windows\assembly\GAC_MSIL /E /R psaadm /T /C

Resources