How to change the location of .vnc directory - vnc

As you know, vnc has a work directory called .vnc which is by default located under user's home directory after you installed the vnc server. How can I change its location? Thanks
Change it from ~/.vnc to /opt/mydirectory/.vnc
Thanks

In my case, just change HOME environment variable before starting up vnc.
export HOME=/opt/mydirectory;
vncserver
This will create .vnc as /opt/mydirectory/.vnc.
I used this trick to use different temporary passwords. It's not a solid solution but just convenient and easy.
Note: on VNC, $HOME is inherited from vnc. You might want to change it back to the regular directory on the vnc session.

Related

Setting PATH environmental variables permanently Centos Web Panel Install... Works from SSH, not Webpage

My zip function isn't working when being called from a php script, but works straight from the SSH prompt.
code in the PHP file that returns nothing var_dump( exec('zip -r domains.zip "domains"') );
code in the php file which works as expected var_dump( exec('/usr/bin/zip -r domains.zip "domains"') );
I've added the path to /etc/profile, I've added it to my ~/.bashrc but can't get the web user to be able to use it.
I'm new to this and it's a VPS so I'm not sure where to go from here.
Ensure that permissions are adequate on the files being accessed - you want to ensure that the user accessing them is able to execute them.

where do I keep my amazon .pem file on a mac

Where should I keep this file for security? At the moment it is on my desktop - should I put it somewhere else?
The 'standard' location would be a .ssh directory in your $HOME. i.e.
/Users/$USER/.ssh/
You should protect this directory with permissions 700. You can set up a config file to automatically use the .pem, and set the username when sshing to EC2 instances as explained here.

Setting path variable for apache user on Amazon EC2

I can't add /usr/local/bin to the apache users PATH variable. The user doesn't have a .profile, I can't su to the user, I can't export to the PATH from php using exec and adding
SetEnv PATH /usr/local/bin
To either the http.conf or the .htaccess file doesn't make a difference. I can't find the envvars file to change that but I suspect there's some other problem.
I have restarted apache, and indeed my server.
Ended up following what Alfe suggested in his answer, except rather than in the /etc/init.d/httpd file (which could be overwritten easily on update) I added to /etc/sysconfig/httpd:
export PATH=${PATH:+$PATH:}/usr/local/bin
Have a look at the /etc/passwd to see which login shell the apache user has (on EC2 Ubuntu instances it should be /bin/sh which is a link to /bin/dash). Then have a look at the man page of that shell and find out which configuration files are read upon login. (For /bin/dash that would be .login in the user's home directory.) In those you should be able to extend your $PATH as you like.
EDIT:
Since you seem to have no login shell for that user: Have a look at the /etc/init.d/* scripts which start the system services. Apache will be one of them. They are started as root and may change the current user (e. g. to the apache user). In there you might be able to adjust the PATH as you like it.
Patching those scripts, however, is not considered typical configuration. Updates might overwrite what ever you patch there.

Cygwin home directory on target system inconsistent

I am having difficulty connecting to a remote Windows system running cygwin.
When I connect from a linux box to cygwin, it connects fine and "sees" the
remote home directory as /home/userID
When I connect from Windows cygwin to the remote windows cygwin, it sees
the home directory as /cygdrive/c/Documents and Settings/UserID
Finally, when I am logged onto the remote Windows machine (the one with the problem)
home is /home/UseID but the value for cygpath -H is
$ echo $(cygpath -H)
/cygdrive/c/Documents and Settings
This seems to be causing my connection problem from windows to windows
and no problem from linux to windows
Any ideas how to fix it?
Since you have the correct path in /etc/passwd, one possibility is that perhaps the SSH client you are using from your Windows systems is sending custom environment values.
If you're using PuTTY, before connecting, look in the tree panel on the left hand side of the dialog. There should be an entry called Connection and a sub-entry called Data which will bring you to an option screen that has a section called Environment variables. Check if the HOME var is being overridden there and if so, remove it.
If you're using a different SSH client, check its configuration to see if its using the SendEnv option. More info on that here: http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config.
Or you could try blocking off custom environments on the destination/server side by disabling AcceptEnv in the SSHd configuration on the system you're connecting to. More info on that here: http://www.openbsd.org/cgi-bin/man.cgi?query=sshd_config.
Hope this helps.

how i can create file "remotely" by vim

i am new vim user
i cannot create file in my host by vim
i use :ftp://user#machine/path
i can connect in my host but i cannot create new file ???
another Q
when i open file how i can back in directory
note. i connect by c panel user and password ,, how i can connect by ftp username and password
thank you and Sorry for my bad English
You can access your remote file in Vim by typing:
vim ftp://user#machine/path/filename
in your command line.
Some things you might want to consider:
If you are using a Unix-like OS on your client machine, you'll probably find it easiest to simply mount your FTP site to a local directory, and then create and edit your files with whatever you like, for example Vim.
As one user suggested, if the host is Unix-like you can connect it via SSH and then edit files with Vim installed over there.

Resources