Nu is a lightweight Bash script that simplifies frequent interactions with remote servers by creating custom, executable shortcuts for SSH connections, SSHFS mounting, and remote command execution.
With Nu, you can instantly SSH into servers, mount remote directories locally, or execute advanced workflows like command chaining and file transfers—all with intuitive, user-defined names.
-
Custom SSH Shortcuts
Create executable scripts in~/bin/for instant access to servers using memorable names (e.g.,Saruman). -
SSHFS Mounting
Transparently mount remote server directories locally using SSHFS for seamless file access. -
Advanced Command Chaining
Execute commands remotely, pipe output to/from remote systems, and transfer files via command-line tools (e.g.,tar,rsync). -
Persistent Configuration
Store server configurations in~/mnt/and reuse access scripts across sessions without reconfiguration.
When you run:
Nu SERVERNAME USERNAME IPADDRESS PORTNu performs the following steps:
- Creates a mount point at
~/mnt/SERVERNAME. - Generates two executable scripts in
~/bin/:SERVERNAME: A shortcut for SSH connections with agent forwarding (-A) and X11 forwarding (-X).MountSERVERNAME: A script to mount the remote server's home directory locally using SSHFS.
- Enables advanced workflows like:
- Remote command execution:
Saruman 'uname -a' - File transfer via pipes:
tar zcf - helloworld | Saruman 'zxvf -'
- Remote-to-local data streaming:
Saruman 'tar jcf - helloworld' | tar zxvf -
- Remote command execution:
Nu Saruman root 65.67.51.189 2222SarumanMountSarumanSaruman 'uname -a' > helloworldtar zcf - helloworld | Saruman 'zxvf -'Saruman 'tar jcf - helloworld' | tar zxvf --
Ensure
~/binis in yourPATH:export PATH=~/bin:$PATH
-
Install dependencies:
sshfs(for mounting remote directories).bash(required for script execution).
-
Install using autotools:
aclocal
autoconf
automake --add-missing
./configure
sudo make installor use ./build.sh to do the same thing.
- Permission Denied Errors: Ensure the
USERNAMEhas SSH access to the remote server. - SSHFS Not Found: Install
sshfsvia your package manager (e.g.,sudo apt install sshfs). - Scripts Not Found: Verify
~/binis in yourPATHand scripts are marked as executable.
This project is licensed under the terms of the LICENSE file.