Eclipse remote system explorer and sudo - eclipse

I use Eclipse RSE to access files on a web server. To establish a sftp connection with Eclipse RSE I use my HippieBandJam user-ID. To edit files I need root access which I only can gain with the sudo command. In Eclipse RSE I have tried to start a new ssh terminal, use sudo su and then refreshed the sftp tree but this does not seem to work. Does anyone have any idea how to "upgrade" the sftp connection so I can edit the files?

If you want something really exotic, you could:
Compile a tiny program in C that does the only thing: execs the shell
Set a suid bit for the executable
Create a new user and set our freshly compiled binary as this user's login shell
Set up proper permissions for the binary, allowing only the new user to execute this file
Use new user's credentials to log onto the server
He-he :-)

Here is one idea:
create a mount point in your local system in /media/
use sshfs cmd to mount the remote server file system directory to .
In eclipse use the project, use add directory to your project
Steps: right click on your project -> New -> Folder -> Advanced (Select link to alternate location) linked folder.
There you have your remote systems files synced up...
Hope this helps!

My workaround for this was to set up the connection to use the root user from the start. First, you need to enable it on your ssh client:
https://forums.aws.amazon.com/thread.jspa?threadID=86876
Then you may have to configure the authorized_keys file:
/root/.ssh/authorized_keys
to accept the key.
Hope that helps! It's not quite as secure, so be wary of this method.

Other Workaround:
NOT ON LIVE SERVER!!!!
Assign the group of the files write rights during the period you are editing them and add your account to the group.

Related

AppImage on Github Releases - Executable Permission

I'm hosting an AppImage file on github releases
https://github.com/Gilad-Kutiel-App/jumpfm/releases.
The file does not have an execution permission when downloaded and it is needed to set it manually.
Is there anything I can do about it ?
Thank you,
Gilad
Before you can run an AppImage (or really any executable for that matter), you need to make it executable. This is a Linux security feature. There are three main ways to make an AppImage executable:
1. With the GUI
Open your file manager and browse to the location of the AppImage
Right-click on the AppImage and click the ‘Properties’ entry
Switch to the Permissions tab and
Click the ‘Allow executing file as program’ checkbox if you are using a Nautilus-based file manager (Files, Nemo, Caja), or click the ‘Is executable’ checkbox if you are using Dolphin, or change the ‘Execute’ drop down list to ‘Anyone’ if you are using PCManFM
Close the dialog
Double-click on the AppImage file to run
2. On the command line
chmod a+x Some.Appimage
3. Automatically with the optional appimaged daemon
If you would like to have all AppImages be executable automatically, you can install the optional appimaged daemon. It will automatically add downloaded AppImages to the menu and make them executable for you. It can be downloaded from https://github.com/AppImage/AppImageKit/releases or installed from your distribution.
On your download page, you can link to the image and/or to http://discourse.appimage.org/t/how-to-make-an-appimage-executable/80
Note: Please DO NOT put an AppImage into another archive like a .zip or .tar.gz. While it may be tempting to avoid users having to set permission, this breaks desktop integration with the optional `appimaged daemon, among other things. Besides, the beauty of the AppImage format is that you never need to unpack anything

eclipse error: glassfish\domains\domain1 does not exist

I have java ee6 web profile sdk & I am using eclipse ee. I installed Glassfish plugin for eclipse using Download additional server adapters in the New Server wizard. Now during building a test app, eclipse raise this error glassfish\domains\domain1 does not exist. Whats the reason & how can I remove it?
Either your eclipse glassfish plugin points to the wrong domain or your server has no domain although there should be at least a default domain which is usually named domain1.
Check what's the name of your domain in glassfish-install-dir\glassfish\domains directory. If there is no subdir, you can create a domain with the asadmin tool:
glassfish-install-dir\bin\asadmin create-domain your-domain-name
See this description of the create-domain command.
If you already have a domain with a different name than domain1, you have to reconfigure your eclipse glassfish plugin. (Since I don't use eclipse, I can't take you any further. But I remember a BalusC tutorial on this topic).
Go to <Glassfish-install-directory>/glassfish/config directory.
Edit asenv and point to your JDK installation for set AS_JAVA=C:\Java\jdk.
Now you should be able to run asadmin.
Create a new domain using asadmin create-domain domain1 (inside bin directory).
Server setup in eclipse will now find your newly created domain.
I ran into this same problem and fixed it with the following:
Open a command prompt and browse to C:\glassfish3\glassfish\bin (or whatever your glassfish directory is)
Execute asadmin
Type in create-domain --adminport 4848 domain1 (your debug port can probably be whatever)
Go back into Eclipse and continue
Although late reply, but may be useful to someone facing similar issues.
If no domain exists in your glassfish path i.e say C:\glassfish4\glassfish\domains\ then you can create a new domain in the same path as follows:
Navigate to C:\glassfish4\bin\ directory and double click on asadmin.bat. It will open a command prompt as asadmin >
Type the following command asadmin > create-domain --adminport 4848 domain1
Click Enter repeatedly to keep the default settings viz. username (admin) password and other things.
That's it. You will find the domain1 created under C:\glassfish4\glassfish\domains\ directory with all default configurations.
If want to create domain in another directory or want some more info then can refer Oracle Glassfish Reference Manual:
http://docs.oracle.com/cd/E19798-01/821-1758/create-domain-1/index.html
Eclipse doesn't have domain path setting for glassfish server. This error comes when domain path is not correct. Make sure when you run your application on eclipse give glassfish credentials user/password
In my case, the C:\glassfish4\glassfish\domains\domain1\config\ domain.xml was renamed to something like domain568912323464576456.xml, so I edited the file, leaving it as it supposed to be named and done, server started up again.
create a new domain with
asadmin create-domain myDomain
add the path of this new domain, if there is a message "domain is not valid", make the folder domains/myDomain/conf permission to not only the root. If there is the message "is not writtable" then open Eclipse as root and try again. This should be work in these cases.
You must to add a password to your admin user. Eclipse mistake. Eclipse doesn't recognise the domain without admin password.
When you create the domain, add a admin user and a password and Eclipse doesn't complain any more.

Deleting files on remote server

I have a PHP project in NetBeans with remote files (over sftp). When I create, modify anything these changes happening both locally and on my web server. However when I'm trying to delete a file or a folder it gets erased only locally. What could be the problem?
Permissions seems to be ok, all files belong to the user I'm using to access the server.
I'm using Netbeans 6.9.1, default configuration, all updates installed.
Netbeans does not have a synchronization function. It is limited to downloading and uploading files. What you can do is to use some external tool, for example WinSCP is capable of synchronizing local and remote directories.
I read what you wrote... but I think it could be a permissions problem.
I also use NetBeans and when I delete a file from the project window it first erase it locally and then syncs with my server.
I login through sftp (using vsftp) as root, which is a bad thing, but you could try this too to be sure if it's a permission issue.
You mistakenly turned off the settings. Please follow these steps:
Right click on the project name
Select properties
From the list of the left select 'Run configuration'
On the left almost down, look for the setting 'Upload files:'
Make sure you set that to 'On Save'
All the best man

Move / backup Netbeans FTP profiles

Trying to figure out how to transfer / back remote connections in netbeans. I have over 100 that I would like to move to a backup computer. Recreating every one of them would be extremely time intensive. I cannot find any way to export the remote profiles and I haven't been able to find the profiles in the .netbeans directory on the local computer.
Is there a file, or any method that would allow moving or backing up the FTP profiles.
The location changed in Netbeans 7.2. The path is the same except AppData\Roaming instead of AppData\Local.
If you are setting up a new windows machine to run Netbeans, you need to first create a dummy remote ftp connection so Netbeans will create the last folder in this file path. Place the .properties files here and then restart Netbeans.
C:\Users\[windowsUsername]\AppData\Roaming\NetBeans\7.2.1\config\Preferences\org\netbeans\modules\php\project\RemoteConnections
The path on Windows would be:
user\.netbeans\6.7\config\Preferences\org\netbeans\modules\php\project\RemoteConnections
For Windows 10:
C:\Users\ (username) \AppData\Roaming\NetBeans\ (netbeans_version) \config\Preferences\org\netbeans\modules\php\project\RemoteConnections

Can I access remote files on a different OS from Eclipse?

I remember i could remotely open files that are on my server via Notepad++. Can I do that with Eclipse so that I can edit files on my computer and when I save it saves on that file directly on the server.
I am using Windows 7 and my server is CentOS (I think).
The Remote Systems Explorer lets you do this. Open "Help > Install new software...", select the "Galileo Update Site", find the Remote Systems Explorer and install it.
Once you've got it installed, open the "Remote Systems" view and add a connection to your favourite server. I use it all the time; works like a charm.
Eclipse normally needs files to be in a project, but if you are able to map the network drive, you can add the remote folder into a project as a linked resource, then it can be modified as if it is on the local machine (except for additional latency).
To maintain portability, you can specify a path variable for the remote file system and define a relative path from that variable. See this answer for details of setting up linked resources.
If mapping the drive is not an option, there is the Remote System Explorer architecture. I've not used it myself so I can't say how well it works, but this blog describes how to use RSE to browse remote files.