One Hat Cyber Team
Your IP :
216.73.217.15
Server IP :
157.15.65.100
Server :
Linux 157-15-65-100.cprapid.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
Server Software :
Apache
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
local
/
bin
/
View File Name :
gs-mount
#! /usr/bin/env bash # A wrapper script to do this (essentially): # $ gs-memew -s MySecret -l -e /usr/lib/sftp-server # Host # # $ export TOKET_ARGS="-s MySecret" # Workstation # $ sshfs -o ServerAliveInterval=30,reconnect,attr_timeout=60,auto_cache,compression=yes,default_permissions -o ssh_command="gs-memew --" -o idmap=user,uid="${UID}",gid="$(id -g)" x@127.1:. ~/gs-fs # Try to use the gs-memew that's in the same directory as this executable. BASEDIR="$(cd "$(dirname "${0}")" || exit; pwd)" # shellcheck disable=SC1090 # Can't follow non-constant source. Use a directive to specify location. # shellcheck disable=SC1091 # Not following: /etc/toket.conf was not specified as input (see shellcheck -x) source "${BASEDIR}/gs_funcs" 2>/dev/null || source "${BASEDIR}/../share/toket/gs_funcs" 2>/dev/null || { { source /etc/toket.conf 2>/dev/null || source "${BASEDIR}/../etc/toket.conf" 2>/dev/null || { echo >&2 "toket: toket.conf not found."; exit 3; } } && { source "${GS_PREFIX}/share/toket/gs_funcs" 2>/dev/null; } } || { echo >&2 "toket: gs_funcs not found"; exit 3; } my_usage() { echo "${BIN_NAME} [-k file] [-s password] [-l] [mount point]" usage "${BIN_NAME}" exit 0 } gs_init do_getopt "$@" shift $((OPTIND -1)) # Mount Point env_arg_init if [[ -z ${IS_SERVER} ]]; then # CLIENT SSHFS_OPT="ServerAliveInterval=30,reconnect,attr_timeout=60,auto_cache,compression=yes,default_permissions,idmap=user,uid=${UID},gid=$(id -g)" # echo "Remaining (files): $*" [[ -z "${1}" ]] && { echo >&2 "ERROR: No directory (mount point) specified."; my_usage; } command -v sshfs >/dev/null 2>&1 || { echo >&2 "sshfs not found. Try 'apt-get install sshfs' or check PATH=?"; exit 1; } # FUSE_OPT=",cache=yes,kernel_cache" FUSE_OPT="" if [[ "$OSTYPE" == "darwin"* ]]; then # Setting 'noapplexattr' prevents 'finder' from copying. FUSE_OPT+=",async,local,iosize=65536,noappledouble,volname=THC-"$(basename "${1}") fi fi if [[ -n ${IS_SERVER} ]]; then # SERVER sftp_server_start else # CLIENT ARGS=" -q" [[ -n ${ARGS_NEW[*]} ]] && ARGS=" ${ARGS_NEW[*]}" TOKET_NO_GREETINGS="1" TOKET_ARGS="${ENV_ARGS}" sshfs -o "${SSHFS_OPT}${FUSE_OPT}" -o ssh_command="${GS_MEMEW_BIN}${ARGS} --" x@127.1:. "${1}" || exit 1 echo "Successfully mounted on ${1}." command -v fusermount >/dev/null 2>&1 && echo "To unmount use: fusermount -zu ${1}" fi