Pysftp open command with port number fails with "invalid port" - port

I'm trying to use psftp (for the first time -- latest and greatest PuTTY installed), to connect to one of my servers. I'll call it example.com. On said server, I have sshd listening on a non-standard port (say, 1234). This works fine, since I can connect via SSH (using PuTTY, or anything else):
ssh -p 1234 <user name>#example.com
No problem.
But, when I try psftp (using what I think should be equivalent syntax
open example.com -P 1234 -l <user name>
I get the following error message:
open: invalid port number
The psftp docs suggest I can use any port between 1 -> 65K or so, and I know port 1234 is valid (despite what psftp is telling me, since I can connect to said port using every other SFTP or SCP client I've tried), but just not psftp.
I must be missing something obvious?
Thanks in advance.

The syntax of the psftp open command is:
open [username#]hostname [port]
So in your case:
open username#example.com 1234
The syntax you have tried to use is psftp command-line syntax.
So alternatively, instead of the open, you can "open" the session right on the commandline using:
psftp example.com -P 1234 -l <user name>
It's similar as with OpenSSH ssh (there you also use commandline syntax).

Related

Login Issue with Weblogic in Docker

I created a Weblogic generic container for version 12.1.3 based on the official Docker images from Oracle at https://github.com/oracle/docker-images/tree/master/OracleWebLogic/dockerfiles
Command: buildDockerImage.sh -g -s -v 12.1.3
This creates the image oracle/weblogic:12.1.3-generic
Using a modified version of sample dockerfile for 1213-domain, I built the Weblogic container.
Note: changed the base image to be generic, instead of developer
docker build -t 1213-domain --build-arg ADMIN_PASSWORD="admin123" -f myDockerfile .
Pushed the built image to Amazon ECR and ran the container using the AWS ECS. Configured the port mappings as 0:7001, set memory soft limit as 1024, nothing else changed in default ECS settings. I have an application load balancer in the front, which receives traffic at 443 port and forwards to the containers. In the browser I get a login page for Weblogic, when I enter username as weblogic and password as admin123, I get the error:
Authentication Denied
Interestingly when I go to the container and connect to the weblogic using WLST, it works fine.
[ec2-user#ip-10-99-103-141 ~]$ docker exec -it 458 bash
[oracle#4580238db23f mydomain]$ /u01/oracle/oracle_common/common/bin/wlst.sh
Initializing WebLogic Scripting Tool (WLST) ...
Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> connect("weblogic","admin123","t3://localhost:7001")
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server "AdminServer" that belongs to domain "mydomain".
Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.
wls:/mydomain/serverConfig>
Any hints on what can be going wrong?
Very interesting indeed. :) .. You are sure there is no special characters or so when you entering the username and password. Try typing the same if you are coping.
Also as backup, since you are able to login to WLST you can try two option.
Resetting the current password of weblogic or try adding new username and password.
below link will help
http://middlewarebuzz.blogspot.com/2013/06/weblogic-password-reset.html
or
http://middlewaremagic.com/weblogic/?p=4962

deploy ruby on rails 5 on AWS

I made an environment on Cloud9 on AWS, then made a folder named "ruby_projects", then inside that folder, I ran the command:
rails new todolist
then from inside the todolist folder, I ran
rails s
In the share button on the top right corner of the environment, I opened the application link which is 35.162.65.187, but instead of saying "you are on rails" it says:
Oops
Error: 1 validation error detected: Value '35.162.65.187' at 'envir..
For changing port on AWS you can do something like this:
sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000
For local machine:
rails server -p 80
But, Phlip absolutely right - you should learn rails on local machine with development environment. Step by step.
You have two ways to preview applications on AWS Cloud9--through the preview URL (from clicking the Preview button) and from the public IP for the host (AKA the sharing URL). The Preview URL is a bit easier to run, but has a few limitations. Specifically:
You need to serve your content on 127.0.0.1:8080 (ports 8081 and 8082 work as well but have to be specified)
You can only access the URL when you are currently logged into the IDE and have the IDE open.
Only IAM users with access to the IDE can access the Preview URL. For instance, this won't work if you are calling this endpoint from another program.
You can read more about the Preview URL here: https://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html#app-preview-preview-app
If you need to share this to people who don't have access to the IDE or you need to access the endpoint through a different program, you'll want to use the Sharing URL. This requires a bit of additional configuration, specifically, you'll have to:
Create a security group for the host that opens your selected ports to the main internet
Run the server through 0.0.0.0 instead of 127.0.0.1
You can see how to do this here: https://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html#app-preview-share

how to connect to bolt with cypher-shell not on localhost

Really want to connect to bolt from an spark slave also but figured if I can get it working with cypher-shell the rest will fall into place. So I can do this:
cypher-shell -a localhost
Connects fine
if I do this on the box which is the actual ip:
cypher-shell -a 172.20.0.71:7687
Get a connection refused, I thought all I had to do was in the conf do:
dbms.connector.bolt.address=0.0.0.0:7687
That didn't seem to work is there something else I am missing?
(Or at least the above didn't seem to work I did restart my neo4j instance so it should of picked up the changes to conf). Connecting just with defaults on cypher-shell does give this still though:
Connected to Neo4j 3.3.0 at bolt://localhost:7687 as user neo4j.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
So maybe it didn't fully restart and pick up the changes to the neo4j.conf ? Or more likely I am missing something else to get this to work as I think it should. Where I can connect from another ip or locally to bolt via the actual ip address?
You need to uncomment this in your neo4j.conf :
dbms.connectors.default_listen_address=0.0.0.0
Restart the server, and then with cypher-shell :
cypher-shell -a bolt://172.20.0.71:7687

Can't connect to a firebird server on docker

I'm a macOS user and I got weird errors just to create a database with firebird. I saw that there are some dock containers with firebird that run just fine ( i was able to create databases, perform queries and so on) but when I tried to connect from my local ISQL or razorSQL client ( through JDBC), I get some weird errors like "unavailable database" or "can't open file"
I'm also not sure how ISQL CONNECT string really works because every site I saw there is a different one.
I got this docker image: ( https://hub.docker.com/r/jacobalberty/firebird/)
I created my container like this:
docker run -d --name firebird -p 3050:3050 -v /data/firebird/databases:/databases jacobalberty/firebird:2.5-ss
my docker-machine IP is:
192.168.99.100
I tried to connect like this:
CONNECT '0.0.0.0:3050://databases/test.fdb' user 'SYSDBA' password 'masterkey';
unavailable database
And also like this:
CONNECT '192.168.99.100:/databases/test.fdb' user 'SYSDBA' password 'masterkey';
connection rejected by remote interface
CONNECT '192.168.99.100:3050:/databases/test.fdb' user 'SYSDBA' password 'masterkey';
Statement failed, SQLSTATE = 08001
unavailable database
When i enter the docker container, the file is there:
root#e4212b9f9d16:/databases# pwd
/databases
root#e4212b9f9d16:/databases# ls
test.fdb
Also, I'm not sure how to check if the firebird server is running ( i guess it is cause I can 'connect' to a database inside the container'.. but the docker container is definally up and running - did a successful telnet on the ip and port)
I also tried to use the container IP (172.17.0.2) but i got a timeout
Im most familiar with mysql and SQLite never touched a firebird db before and as the user got this DB, i have to mock it, develop an app using fake data and then connect it to the real firebird (so changing the DB is not an option)
So, the standard documentation about 'create your firebird server' don't mention but you on firebird.conf, the variable RemoteBindAddress must be empty
File:
/etc/firebird/2.5/firebird.conf
Lines changed:
RemoteBindAddress =
#RemoteBindAddress = localhost
Thanks for all the
Most of your problems are your connection string, it should be <host>/<port>:<database-path-or-alias>, where leaving of /<port> will default to port 3050.
This accounts for all your problems except for
CONNECT '192.168.99.100:/databases/test.fdb' user 'SYSDBA' password 'masterkey';
connection rejected by remote interface
As that connection string is a valid one.
This error means that you were able to connect to the server, but the connection was rejected. This might - for example - happen when you use Firebird 3, but connect using a Firebird 2.5 ISQL/fbclient library, and haven't relaxed the security settings of Firebird 3 (see Legacy Authentication in the Firebird 3 release notes).
In order to find out if the server is running, use:
docker ps
In order to figure out if the server actually started, or errored out upon start, start the container without the -d and look at the log messages when it runs:
docker run --name firebird -p 3050:3050 -v /data/firebird/databases:/databases jacobalberty/firebird:2.5-ss

cannot run shellinabox through a php api on centos

I want to start shellinabox on centos through a php api.
When the user hits the api, shellinaboxd -p 'portno' command should get executed and shellinabox should start on the particular port number.
But this does not happen, instead this error comes
Error :
Failed to find any available port [on tail -f /var/log/httpd/error_log]
The code below runs correctly on ubuntu but not on centos.
Consider rest all things working fine.
$app->get('/test', function() {
exec('shellinaboxd -p '.$port);
});
Executing:
shellinaboxd -p 'someport' on bash also works fine.
I have php5.5 and apache2 installed on my system.
Error message Failed to find any available port tells you that port is already used.
Try different port.
I have come out with a solution. Centos is SELINUX(Secured linux). So it does not allow any logging action from a process, like php api(in my case, whose user is apache) in its default mode that is "enforcing".
So change the SELINUX mode as:
'SELINUX=disabled' in /etc/selinux/config
and reboot.
It has one more mode i.e. permissive.
Read more about it here: https://wiki.centos.org/HowTos/SELinux

Resources